summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2020-01-22 08:01:58 +0200
committerAlex Grönholm <alex.gronholm@nextday.fi>2020-01-22 08:40:15 +0200
commit9aa8480b5d2d033dbd9b634fa736d8f25150c40d (patch)
treee434bcd616c613baf693999c1331e3650944684b
parente29a5bdd0817f4068aac83edf110caf7c421f574 (diff)
downloadwheel-git-9aa8480b5d2d033dbd9b634fa736d8f25150c40d.tar.gz
Switched to setuptools_scm
New versions are now made by declaring a new version in the changelog (docs/news.rst) and pushing this change to Github. The workflow will see this version and create a new tag which then triggers the release workflow.
-rw-r--r--.gitignore1
-rw-r--r--MANIFEST.in10
-rw-r--r--docs/development.rst13
-rw-r--r--docs/news.rst3
-rw-r--r--pyproject.toml6
-rw-r--r--setup.cfg2
-rw-r--r--setup.py2
-rw-r--r--src/wheel/__init__.py3
8 files changed, 17 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index d77ca1a..ae5be45 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@
build
dist
docs/_build
+src/wheel/_version.py
__pycache__
.coverage
.pytest_cache
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 863d1da..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,10 +0,0 @@
-recursive-include src *.py
-recursive-include tests *.py *.h *.txt *.c *.dynlib
-recursive-include docs *.py *.rst make.bat Makefile
-include tests/testdata/test-1.0-py2.py3-none-any.whl
-include tox.ini
-include manpages/*.rst
-include pyproject.toml
-prune tests/testdata/*/build
-prune tests/testdata/*/dist
-prune tests/testdata/*/*.egg-info
diff --git a/docs/development.rst b/docs/development.rst
index 53c33e3..3726040 100644
--- a/docs/development.rst
+++ b/docs/development.rst
@@ -83,11 +83,8 @@ The wheel project welcomes help in the following ways:
Release Process
---------------
-#. Make sure there is a version block for this release in ``docs/news.rst``
- that mentions all the new user-facing changes
-#. Add the version tag to the repository using ``git tag X.Y.Z``
- (e.g. ``git tag 1.0.1``)
-#. Push the new tag to Github using ``git push --tags``
-
-When a new tag is pushed to Github, Travis will pick it up and automatically
-build the sdist and wheel and upload them to PyPI.
+To make a new release, edit ``docs/news.rst`` and add a new version and replace
+``**UNRELEASED**`` with a release version and date, like
+``**X.Y.Z (20XX-YY-ZZ)**``. The github workflow will pick up the new version
+and create a new tag, which will then trigger the release workflow which will
+package the project and publish the resulting artifacts to PyPI.
diff --git a/docs/news.rst b/docs/news.rst
index e9423b1..731c4d4 100644
--- a/docs/news.rst
+++ b/docs/news.rst
@@ -10,6 +10,9 @@ Release Notes
- Moved the contents of setup.py to setup.cfg
- Fixed duplicate RECORD file when using "wheel pack" on Windows
- Switched the project to use the "src" layout
+. Switched to setuptools_scm_ for versioning
+
+ .. _setuptools_scm: https://github.com/pypa/setuptools_scm/
**0.33.6 (2019-08-18)**
diff --git a/pyproject.toml b/pyproject.toml
index 7adac75..f5c4199 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,7 @@
[build-system]
-requires = ["setuptools >= 40.9.0"]
+requires = ["setuptools >= 42", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"
+
+[tool.setuptools_scm]
+write_to = "src/wheel/_version.py"
+version_scheme = "post-release"
diff --git a/setup.cfg b/setup.cfg
index a3dd482..798be73 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,5 @@
[metadata]
name = wheel
-version = attr: wheel.__version__
description = A built-package format for Python
long_description = file: README.rst
classifiers =
@@ -33,6 +32,7 @@ package_dir=
= src
packages = find:
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
+setup_requires = setuptools_scm >= 3.4
zip_safe = False
[options.packages.find]
diff --git a/setup.py b/setup.py
index 6068493..d5d43d7 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,3 @@
from setuptools import setup
-setup()
+setup(use_scm_version=True)
diff --git a/src/wheel/__init__.py b/src/wheel/__init__.py
index 5df0e1b..d986e5b 100644
--- a/src/wheel/__init__.py
+++ b/src/wheel/__init__.py
@@ -1,2 +1 @@
-# __variables__ with double-quoted values will be available in setup.py:
-__version__ = "0.33.6"
+from ._version import version as __version__ # noqa: F401