diff --git a/.github/workflows/publish-sdist.yml b/.github/workflows/publish-sdist.yml index 0feb880..96f318c 100644 --- a/.github/workflows/publish-sdist.yml +++ b/.github/workflows/publish-sdist.yml @@ -16,9 +16,9 @@ jobs: with: python-version: 3.8 - name: Build a source tarball - run: - python setup.py sdist - + run: | + pip install setuptools>=42 wheel setuptools_scm[toml]>=3.4 + python setup.py sdist bdist_wheel - name: Publish distribution package to PyPI uses: pypa/gh-action-pypi-publish@master with: diff --git a/.gitignore b/.gitignore index 2c71193..4cac045 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ doc/build doc/source/generated reports .vscode + +luigi_tools/version.py diff --git a/luigi_tools/__init__.py b/luigi_tools/__init__.py index 7ed3db7..5b90c96 100644 --- a/luigi_tools/__init__.py +++ b/luigi_tools/__init__.py @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. """ -from luigi_tools.version import __version__ +from pkg_resources import get_distribution + +__version__ = get_distribution("luigi-tools").version diff --git a/luigi_tools/version.py b/luigi_tools/version.py deleted file mode 100644 index 8c3232a..0000000 --- a/luigi_tools/version.py +++ /dev/null @@ -1,5 +0,0 @@ -"""The package version. - -This file was generated automatically, do not change it. -""" -__version__ = "0.0.11.dev1" diff --git a/pyproject.toml b/pyproject.toml index ff4544c..7cda8a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ # pyproject.toml [build-system] requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] + +[tool.setuptools_scm] +local_scheme = "no-local-version" diff --git a/setup.py b/setup.py index d3e8cba..734c62e 100644 --- a/setup.py +++ b/setup.py @@ -40,11 +40,6 @@ setup( name="luigi-tools", author="Blue Brain Project, EPFL", - use_scm_version={ - "write_to": "luigi_tools/version.py", - "write_to_template": version_template, - "local_scheme": "no-local-version", - }, description="Tools to work with luigi", long_description=README, long_description_content_type="text/markdown", diff --git a/tox.ini b/tox.ini index a445acd..abf321a 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = py{36,37,38} py36-lint py38-docs + py38-check-packaging minversion = 3.1.0 @@ -29,11 +30,12 @@ commands = pytest \ --self-contained-html \ {posargs} -[testenv:check-packaging] +[testenv:py38-check-packaging] skip_install = true deps = wheel twine + setuptools_scm[toml]>=3.4 commands = python setup.py sdist bdist_wheel -d {envtmpdir}/dist twine check {envtmpdir}/dist/* @@ -86,4 +88,4 @@ convention = google python = 3.6: py36, py36-lint 3.7: py37 - 3.8: py38, py38-docs + 3.8: py38, py38-docs, py38-check-packaging