diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..34cbabc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + workflow_dispatch: + pull_request: + +jobs: + python-unit: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + defaults: + run: + working-directory: . + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: '**/pyproject.toml' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install .[test] + + - name: Run unit tests + run: | + pytest diff --git a/.gitignore b/.gitignore index ba74660..ab3165a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # Distribution / packaging .Python env/ +venv/ build/ develop-eggs/ dist/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e3377a3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: python -sudo: false -cache: pip -python: -- '3.6' -- '2.7' -before_install: -- pip install nose coverage 'django<2' -script: -- nosetests --verbose --with-coverage --cover-package=edtf -after_success: -- coverage report diff --git a/changelog.rst b/changelog.rst index 690f2ed..6a302ae 100644 --- a/changelog.rst +++ b/changelog.rst @@ -8,6 +8,9 @@ In development -------------------------- * Breaking Changes: Rename project back to edtf from edtf2, after the merge of work form https://github.com/saw-leipzig/python-edtf/ +* Breaking Changes: Drop support for Python 2 and Python 3 versions below 3.8. `v5` will support Python 3.8 to 3.12 at release. +* Switch from `tox` and `nose` to `pytest` for testing. +* Consolidate config and packaging from `setup.py` and `setup.cfg` to `pyproject.toml`. 5.0.0 (2023-10-04) ------------------ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..444298e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,74 @@ +[project] +name = "edtf" +version = "5.0.0" +dependencies = [ + "python-dateutil", + "pyparsing", + "six" +] +description = "Python implementation of Library of Congress EDTF (Extended Date Time Format) specification" +requires-python = ">=3.8" +readme = {file = "README.txt", content-type = "text/markdown"} +authors = [ + { name = "The Interaction Consortium", email = "studio@interaction.net.au"}, + { name = "Alastair Weakley"}, + { name = "James Murty"}, + { name = "Mark Finger" }, + { name = "Sabine Müller" }, + { name = "Cole Crawford" } +] +maintainers = [ + { name = "The Interaction Consortium", email = "studio@interaction.net.au" } +] +classifiers = [ + "Intended Audience :: Developers", + "Intended Audience :: End Users/Desktop", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] + +[project.optional-dependencies] +test = [ + "django", + "pytest" +] + +[project.urls] +homepage = "https://github.com/ixc/python-edtf" +issues = "https://github.com/ixc/python-edtf/issues" +repository = "https://github.com/ixc/python-edtf.git" +changelog = "https://github.com/ixc/python-edtf/blob/main/changelog.rst" + +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.wheel] +universal = false + +[tool.tox] +legacy_tox_ini = """ + [tox] + min_version = 4.0 + env_list = py{38,39,310,311,312} + isolated_build = true + skip_missing_interpreters = True + + [testenv] + deps = + pytest + django + commands = pytest +""" + +[tool.pytest.ini_options] +python_files = ["tests.py", "test_*.py", "*_test.py", "*_tests.py"] +python_classes = ["Test*", "*Tests"] +python_functions = ["test_*"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 082465a..0000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[devpi:upload] -formats = bdist_wheel - -[wheel] -universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100644 index 8fcc6aa..0000000 --- a/setup.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import print_function - -import setuptools -import sys - -version = '5.0.0' - -def readme(): - with open('README.md') as f: - return f.read() - -setuptools.setup( - name='edtf', - version=version, - #use_scm_version={'version_scheme': 'post-release'}, - url='https://github.com/ixc/python-edtf', - author='The Interaction Consortium', - author_email='studio@interaction.net.au', - description='Python implementation of Library of Congress EDTF (Extended ' - 'Date Time Format) specification', - long_description=readme(), - long_description_content_type="text/markdown", - license='MIT', - packages=setuptools.find_packages(), - include_package_data=True, - install_requires=[ - 'python-dateutil', - 'pyparsing', - 'six' - ], - extras_require={ - 'test': [ - 'django', - 'nose', - 'tox', - ], - }, - setup_requires=[ - 'setuptools_scm >=5.0.2, <6.0.0', - ], - keywords=[ - 'edtf', - ], - classifiers=[ - 'Intended Audience :: Developers', - 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: MIT License', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.6', - ], -) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index f70761f..0000000 --- a/tox.ini +++ /dev/null @@ -1,8 +0,0 @@ -[tox] -envlist = py27,py36 - -[testenv] -deps= - nose - django -commands=nosetests