Skip to content

Commit 2ace19f

Browse files
committed
modernise packaging
update actions move to pytest move tests out of src
1 parent 8856fdf commit 2ace19f

31 files changed

+873
-1119
lines changed

.coveragerc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
lint:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-24.04
88

99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-python@v2
12-
- uses: pre-commit/[email protected]
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
12+
with:
13+
python-version: "3.12"
14+
- uses: pre-commit/[email protected]

.github/workflows/test.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10"]
14+
python-version: ["pypy-3.9", "3.9", "3.10", "3.11", "3.12"]
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
include:
1717
# Include new variables for Codecov
@@ -20,27 +20,24 @@ jobs:
2020
- { codecov-flag: GHA_Windows, os: windows-latest }
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424

2525
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
26+
uses: actions/setup-python@v5
2727
with:
2828
python-version: ${{ matrix.python-version }}
2929
cache: pip
30-
cache-dependency-path: "setup.py"
3130

3231
- name: Install dependencies
3332
run: |
34-
python -m pip install -U pip
35-
python -m pip install -U wheel
36-
python -m pip install -U tox
33+
python -m pip install -U pip wheel tox
3734
3835
- name: Tox tests
3936
run: |
4037
tox -e py
4138
4239
- name: Upload coverage
43-
uses: codecov/codecov-action@v2
40+
uses: codecov/codecov-action@v4
4441
with:
4542
flags: ${{ matrix.codecov-flag }}
4643
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ parts
1212
.coverage
1313
coverage.xml
1414
htmlcov
15+
src/isodate/version.py
16+
.eggs
17+
.vscode/

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.29.1
3+
rev: v3.17.0
44
hooks:
55
- id: pyupgrade
6-
args: [--py37-plus]
6+
args: [--py39-plus]
77

88
- repo: https://github.com/pycqa/flake8
9-
rev: 4.0.1
9+
rev: 7.1.1
1010
hooks:
1111
- id: flake8
1212
args:
1313
- "--max-line-length=88"
1414

1515
- repo: https://github.com/pre-commit/pygrep-hooks
16-
rev: v1.9.0
16+
rev: v1.10.0
1717
hooks:
1818
- id: python-check-blanket-noqa
1919

2020
- repo: https://github.com/pre-commit/pre-commit-hooks
21-
rev: v4.0.1
21+
rev: v5.0.0
2222
hooks:
2323
- id: check-merge-conflict
2424
- id: check-yaml

CHANGES.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@
22
CHANGES
33
=======
44

5-
0.7.0 (unreleased)
5+
0.7.1 (unreleased)
6+
------------------
7+
8+
- no changes yet
9+
10+
11+
0.7.0 (2024-10-08)
612
------------------
713

814
- drop end of life python versions
915
- Don't match garbage characters at the end of parsed strings #16 (Gabriel de Perthuis)
10-
- Breaking: fractional seconds are cut off to microseconds (round down)
16+
17+
18+
Potentially breaking changes:
19+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+
21+
- Fractional seconds are cut off to microseconds (always round down)
1122
- Allow control over return type of parse_duration #64 (Felix Claessen)
1223

1324

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ As this module maps ISO 8601 dates/times to standard Python data types, like
3333
all possible ISO 8601 dates/times. For instance, dates before 0001-01-01 are
3434
not allowed by the Python *date* and *datetime* classes. Additionally
3535
fractional seconds are limited to microseconds. That means if the parser finds
36-
for instance nanoseconds it will round it to microseconds.
36+
for instance nanoseconds it will round it down to microseconds.
3737

3838
Documentation
3939
-------------
@@ -88,8 +88,7 @@ Installation
8888

8989
This module can easily be installed with Python standard installation methods.
9090

91-
Either use *python setup.py install* or in case you have *setuptools* or
92-
*distribute* available, you can also use *easy_install*.
91+
Use *pip install isodate*.
9392

9493
Limitations
9594
-----------
@@ -113,4 +112,4 @@ the methods and their limitations.
113112
The source release provides a *setup.py* script,
114113
which can be used to run the unit tests included.
115114

116-
Source code is available at `<http://github.com/gweis/isodate>`_.
115+
Source code is available at `<https://github.com/gweis/isodate>`_.

pyproject.toml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[project]
2+
name = "isodate"
3+
description = "An ISO 8601 date/time/duration parser and formatter"
4+
# TODO: long_description = "file: README.rst, CHANGES.txt, TODO.txt"
5+
# TODO: url = "https://github.com/gweis/isodate/"
6+
authors = [{name="Gerhard Weis"}]
7+
# keywords =
8+
license = {file = "LICENSE"}
9+
# license = {text="BSD-3-Clause"}
10+
#TODO: license_files = "LICENSE"
11+
classifiers = [
12+
"Development Status :: 4 - Beta",
13+
"Intended Audience :: Developers",
14+
"License :: OSI Approved :: BSD License",
15+
"Operating System :: OS Independent",
16+
"Programming Language :: Python",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: Implementation :: CPython",
24+
"Programming Language :: Python :: Implementation :: PyPy",
25+
"Topic :: Internet",
26+
"Topic :: Software Development :: Libraries :: Python Modules",
27+
]
28+
# requires-python = ">3.7"
29+
dynamic = ["version"]
30+
31+
32+
[build-system]
33+
requires = ["setuptools", "setuptools_scm[toml]"]
34+
build-backend = "setuptools.build_meta"
35+
36+
[tool.setuptools_scm]
37+
write_to = "src/isodate/version.py"
38+
fallback_version = "0.0.0.dev0"
39+
40+
41+
[tool.pytest.ini_options]
42+
testpaths = ["tests"]
43+
filterwarnings = [
44+
# treat all warnings as errors
45+
"error",
46+
# ignore:<regexp>
47+
# e.g.:
48+
# ignore:jsonschema.RefResolver is deprecated as of v4.18.0
49+
]
50+
junit_family = "xunit2"
51+
52+
[tool.coverage.run]
53+
source_pkgs = ["isodate"]
54+
omit = ["tests/"]
55+
56+
[tool.black]
57+
line-length = 88
58+
59+
[tool.isort]
60+
profile = "black"

setup.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)