diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2ce98fe..af154f1 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest"] - python-version: ['3.6', '3.8'] + python-version: ['3.8'] ymlfile: ['environment.yml'] include: - python-version: 3.8 @@ -18,11 +18,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true # does not work with self-hosted testdata fetch-depth: 0 - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" auto-update-conda: true @@ -65,24 +65,16 @@ jobs: shell: bash -l {0} run: | git status - pip install setuptools_scm - if [ ${{ matrix.os }} == "windows-latest" ] - then - # build whls on windows - pip install wheel - python setup.py bdist_wheel --dist-dir ./dist - else - # build dist on linux - python setup.py sdist --dist-dir ./dist - fi + pip install build + python -m build ls ./dist - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Artifacts path: ./dist/* - name: Publish package - if: ${{ matrix.pypi }} + if: ${{ matrix.pypi && github.repository == 'cpaulik/datedown' }} uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/README.rst b/README.rst index 53f05d4..5b95c01 100644 --- a/README.rst +++ b/README.rst @@ -25,6 +25,8 @@ moment. Installation ============ +Requires Python >= 3.8. + * Install `wget `_ if it is not already on your system. * ``pip install datedown`` @@ -79,5 +81,5 @@ API Documentation for more details about these functions. Note ==== -This project has been set up using PyScaffold 3.3 For details and usage -information on PyScaffold see http://pyscaffold.readthedocs.org/. +This project has been set up using PyScaffold 4.6. For details and usage +information on PyScaffold see https://pyscaffold.org/. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..eed370e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +version_scheme = "no-guess-dev" diff --git a/setup.cfg b/setup.cfg index 8ae4a13..95ccfd2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ include_package_data = True package_dir = =src # DON'T CHANGE THE FOLLOWING LINE! IT WILL BE UPDATED BY PYSCAFFOLD! -setup_requires = pyscaffold>=3.3a0,<4 +setup_requires = pyscaffold>=4,<5 # Add here dependencies of your project (semicolon/line-separated), e.g. # install_requires = numpy; scipy # The usage of test_requires is discouraged, see `Dependency Management` docs @@ -115,5 +115,5 @@ exclude = [pyscaffold] # PyScaffold's parameters when the project was created. # This will be used when updating. Do not change! -version = 3.3 +version = 4.6 package = datedown \ No newline at end of file diff --git a/setup.py b/setup.py index 791106b..446a4d9 100644 --- a/setup.py +++ b/setup.py @@ -1,22 +1,5 @@ -# -*- coding: utf-8 -*- -""" - Setup file for datedown. - Use setup.cfg to configure your project. - - This file was generated with PyScaffold 3.3. - PyScaffold helps you to put up the scaffold of your new Python project. - Learn more under: https://pyscaffold.org/ -""" -import sys -from pkg_resources import VersionConflict, require from setuptools import setup -try: - require("setuptools>=38.3") -except VersionConflict: - print("Error: version of setuptools is too old (<38.3)!") - sys.exit(1) - if __name__ == "__main__": - setup(use_pyscaffold=True) + setup(use_scm_version={"version_scheme": "no-guess-dev"}) diff --git a/src/datedown/__init__.py b/src/datedown/__init__.py index 07d78fd..268dc86 100644 --- a/src/datedown/__init__.py +++ b/src/datedown/__init__.py @@ -1,11 +1,9 @@ -# -*- coding: utf-8 -*- -from pkg_resources import DistributionNotFound, get_distribution +from importlib.metadata import PackageNotFoundError, version try: - # Change here if project is renamed and does not equal the package name dist_name = __name__ - __version__ = get_distribution(dist_name).version -except DistributionNotFound: + __version__ = version(dist_name) +except PackageNotFoundError: __version__ = "unknown" finally: - del get_distribution, DistributionNotFound + del version, PackageNotFoundError