Skip to content

Setuptools scm#97

Open
graingert wants to merge 5 commits intopytest-dev:mainfrom
graingert:setuptools-scm
Open

Setuptools scm#97
graingert wants to merge 5 commits intopytest-dev:mainfrom
graingert:setuptools-scm

Conversation

@graingert
Copy link
Copy Markdown
Member

@graingert graingert commented Apr 3, 2026

whl diff between setup-cfg and setuptools-scm branches

whl diff

diff -ru main/dist-info/METADATA setuptools-scm/dist-info/METADATA
--- main/dist-info/METADATA	2026-04-03 09:12:26.000000000 +0000
+++ setuptools-scm/dist-info/METADATA	2026-04-03 09:12:40.000000000 +0000
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: unittest2pytest
-Version: 0.6.dev0
+Version: 0.6.dev29+gffb31cd3c
 Summary: Convert unittest test-cases to pytest
 Author-email: Hartmut Goebel <h.goebel@crazy-compilers.com>
 License-Expression: GPL-3.0-or-later
@@ -133,6 +133,30 @@
 
 *UNRELEASED*
 
+- Switch from lib2to3 to `fissix <https://github.com/amyreese/fissix>`_,
+  a maintained fork of lib2to3 (`#95`_).
+
+- Add Python 3.13, 3.14, and 3.15 support.
+
+- Migrate packaging from ``setup.py`` to ``pyproject.toml`` with
+  PEP 639 SPDX license metadata (``GPL-3.0-or-later``) (`#96`_).
+
+- Use ``setuptools-scm`` for version management. Versions are now
+  derived from git tags (`#97`_).
+
+- Add ``check_changelog.py`` CI check to enforce changelog entries
+  (`#97`_).
+
+- Gate PyPI publishing on tests passing by merging the release
+  workflow into CI (`#97`_).
+
+- Update installation instructions with ``uv tool install`` (`#92`_).
+
+.. _#92: https://github.com/pytest-dev/unittest2pytest/pull/92
+.. _#95: https://github.com/pytest-dev/unittest2pytest/pull/95
+.. _#96: https://github.com/pytest-dev/unittest2pytest/pull/96
+.. _#97: https://github.com/pytest-dev/unittest2pytest/pull/97
+
 
 0.5
 ---
diff -ru main/dist-info/RECORD setuptools-scm/dist-info/RECORD
--- main/dist-info/RECORD	2026-04-03 09:12:26.000000000 +0000
+++ setuptools-scm/dist-info/RECORD	2026-04-03 09:12:40.000000000 +0000
@@ -1,14 +1,14 @@
-unittest2pytest/__init__.py,sha256=pDvMzi1GmOMxu3-R6hxRI_ZVaB3HBtEb9tUq_tDm3Ks,1000
+unittest2pytest/__init__.py,sha256=y2rWj75fd_fXnM00KBkirLBFbrlDabt_fhxmvgXKr-g,1089
 unittest2pytest/__main__.py,sha256=uC-GqK7Ft2lS-dOLWAkfGJMDGbXXH5hLuBk_OAsssyY,1091
-unittest2pytest/_version.py,sha256=_7ae39qNq9CBlt_5dAx-iPNr_6TmB9aJCl5V7xdtr6U,563
+unittest2pytest/_version.py,sha256=41aIm9Tqv1pBIcz6HYETmv_qjjvQIzfTORnSkkZPYJw,555
 unittest2pytest/utils.py,sha256=P20ACoaciXwDZ5AAzp9RVTVGC4x-6rG7BCYQwH5sD7Q,1738
 unittest2pytest/fixes/__init__.py,sha256=MsSFjiLMLJZ7QhUPpVBWKiyDnCzryquRyr329NoCACI,2
 unittest2pytest/fixes/fix_remove_class.py,sha256=Wuosv3QhCf8_aFZ8B1vJgTQ4JGF6wtcdtbXZ7Q0gi80,2780
 unittest2pytest/fixes/fix_self_assert.py,sha256=PTyzaLSqDnGh-sdHrBUYA8_XleLxkNcEnRN171oDvcE,16717
-unittest2pytest-0.6.dev0.dist-info/licenses/AUTHORS.txt,sha256=b8CwrXUsgKEAa2JBX5cttbUsb68ZvdcQ1CuL_JSE09A,941
-unittest2pytest-0.6.dev0.dist-info/licenses/COPYING-GPLv3.txt,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
-unittest2pytest-0.6.dev0.dist-info/METADATA,sha256=ZpOtRpAlyGyGhwTI783a6QmycRdNu_yM_ZJqs-BF408,5716
-unittest2pytest-0.6.dev0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
-unittest2pytest-0.6.dev0.dist-info/entry_points.txt,sha256=EP8-0SMaIaC4fkmVUCG1cRhwOJZffcGJ6yGUurH9qo0,66
-unittest2pytest-0.6.dev0.dist-info/top_level.txt,sha256=sKQCbFtrGyQMbYJST27LYZ3Rblil8LPZr25xSuCCbjk,16
-unittest2pytest-0.6.dev0.dist-info/RECORD,,
+unittest2pytest-0.6.dev29+gffb31cd3c.dist-info/licenses/AUTHORS.txt,sha256=b8CwrXUsgKEAa2JBX5cttbUsb68ZvdcQ1CuL_JSE09A,941
+unittest2pytest-0.6.dev29+gffb31cd3c.dist-info/licenses/COPYING-GPLv3.txt,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
+unittest2pytest-0.6.dev29+gffb31cd3c.dist-info/METADATA,sha256=7-J8xgWlF7AtiW5MenytcW8ipSJZ3FmtTCbVtd_2YlM,6616
+unittest2pytest-0.6.dev29+gffb31cd3c.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
+unittest2pytest-0.6.dev29+gffb31cd3c.dist-info/entry_points.txt,sha256=EP8-0SMaIaC4fkmVUCG1cRhwOJZffcGJ6yGUurH9qo0,66
+unittest2pytest-0.6.dev29+gffb31cd3c.dist-info/top_level.txt,sha256=sKQCbFtrGyQMbYJST27LYZ3Rblil8LPZr25xSuCCbjk,16
+unittest2pytest-0.6.dev29+gffb31cd3c.dist-info/RECORD,,
diff -ru main/unittest2pytest/__init__.py setuptools-scm/unittest2pytest/__init__.py
--- main/unittest2pytest/__init__.py	2026-04-03 09:12:14.000000000 +0000
+++ setuptools-scm/unittest2pytest/__init__.py	2026-04-03 09:12:26.000000000 +0000
@@ -23,4 +23,8 @@
 
 
 __title__ = 'unittest2pytest'
-__version__ = '0.6.dev0'
+
+try:
+    from ._version import version as __version__
+except ImportError:
+    __version__ = "0.0.0.dev0+unknown"
diff -ru main/unittest2pytest/_version.py setuptools-scm/unittest2pytest/_version.py
--- main/unittest2pytest/_version.py	2026-04-03 09:11:52.000000000 +0000
+++ setuptools-scm/unittest2pytest/_version.py	2026-04-03 09:12:40.000000000 +0000
@@ -21,4 +21,4 @@
 __version__ = version = '0.6.dev29+gffb31cd3c'
 __version_tuple__ = version_tuple = (0, 6, 'dev29', 'gffb31cd3c')
 
-__commit_id__ = commit_id = 'gffb31cd3c'
+__commit_id__ = commit_id = None

Sdist diff

diff -ru main/CHANGELOG.rst setuptools-scm/CHANGELOG.rst
--- main/CHANGELOG.rst	2026-04-03 09:12:15.000000000 +0000
+++ setuptools-scm/CHANGELOG.rst	2026-04-03 09:12:27.000000000 +0000
@@ -6,6 +6,30 @@
 
 *UNRELEASED*
 
+- Switch from lib2to3 to `fissix <https://github.com/amyreese/fissix>`_,
+  a maintained fork of lib2to3 (`#95`_).
+
+- Add Python 3.13, 3.14, and 3.15 support.
+
+- Migrate packaging from ``setup.py`` to ``pyproject.toml`` with
+  PEP 639 SPDX license metadata (``GPL-3.0-or-later``) (`#96`_).
+
+- Use ``setuptools-scm`` for version management. Versions are now
+  derived from git tags (`#97`_).
+
+- Add ``check_changelog.py`` CI check to enforce changelog entries
+  (`#97`_).
+
+- Gate PyPI publishing on tests passing by merging the release
+  workflow into CI (`#97`_).
+
+- Update installation instructions with ``uv tool install`` (`#92`_).
+
+.. _#92: https://github.com/pytest-dev/unittest2pytest/pull/92
+.. _#95: https://github.com/pytest-dev/unittest2pytest/pull/95
+.. _#96: https://github.com/pytest-dev/unittest2pytest/pull/96
+.. _#97: https://github.com/pytest-dev/unittest2pytest/pull/97
+
 
 0.5
 ---
diff -ru main/MANIFEST.in setuptools-scm/MANIFEST.in
--- main/MANIFEST.in	2026-04-03 09:12:15.000000000 +0000
+++ setuptools-scm/MANIFEST.in	2026-04-03 09:12:27.000000000 +0000
@@ -1,8 +1,8 @@
-include CHANGELOG.rst
-include COPYING-GPLv3.txt
-include NEWLINE.rst
-include README.rst
-
-recursive-include tests *
-recursive-exclude * __pycache__
-recursive-exclude * *.py[co]
+exclude .gitignore
+exclude RELEASE_PROCESS.md
+exclude make_changelog.py
+exclude check_changelog.py
+exclude DEVELOPER.rst
+exclude RELEASING.rst
+exclude tox.ini
+prune .github
diff -ru main/PKG-INFO setuptools-scm/PKG-INFO
--- main/PKG-INFO	2026-04-03 09:12:21.483037200 +0000
+++ setuptools-scm/PKG-INFO	2026-04-03 09:12:34.614038500 +0000
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: unittest2pytest
-Version: 0.6.dev0
+Version: 0.6.dev29+gffb31cd3c
 Summary: Convert unittest test-cases to pytest
 Author-email: Hartmut Goebel <h.goebel@crazy-compilers.com>
 License-Expression: GPL-3.0-or-later
@@ -133,6 +133,30 @@
 
 *UNRELEASED*
 
+- Switch from lib2to3 to `fissix <https://github.com/amyreese/fissix>`_,
+  a maintained fork of lib2to3 (`#95`_).
+
+- Add Python 3.13, 3.14, and 3.15 support.
+
+- Migrate packaging from ``setup.py`` to ``pyproject.toml`` with
+  PEP 639 SPDX license metadata (``GPL-3.0-or-later``) (`#96`_).
+
+- Use ``setuptools-scm`` for version management. Versions are now
+  derived from git tags (`#97`_).
+
+- Add ``check_changelog.py`` CI check to enforce changelog entries
+  (`#97`_).
+
+- Gate PyPI publishing on tests passing by merging the release
+  workflow into CI (`#97`_).
+
+- Update installation instructions with ``uv tool install`` (`#92`_).
+
+.. _#92: https://github.com/pytest-dev/unittest2pytest/pull/92
+.. _#95: https://github.com/pytest-dev/unittest2pytest/pull/95
+.. _#96: https://github.com/pytest-dev/unittest2pytest/pull/96
+.. _#97: https://github.com/pytest-dev/unittest2pytest/pull/97
+
 
 0.5
 ---
diff -ru main/pyproject.toml setuptools-scm/pyproject.toml
--- main/pyproject.toml	2026-04-03 09:12:15.000000000 +0000
+++ setuptools-scm/pyproject.toml	2026-04-03 09:12:27.000000000 +0000
@@ -1,5 +1,5 @@
 [build-system]
-requires = ["setuptools>=77"]
+requires = ["setuptools>=77", "setuptools-scm>=8"]
 build-backend = "setuptools.build_meta"
 
 [project]
@@ -43,11 +43,7 @@
 
 [tool.setuptools.dynamic]
 readme = {file = ["README.rst", "NEWLINE.rst", "CHANGELOG.rst"], content-type = "text/x-rst"}
-version = {attr = "unittest2pytest.__version__"}
 
-[tool.zest-releaser]
-python-file-with-version = "unittest2pytest/__init__.py"
-push-changes = false
-tag-format = "v{version}"
-tag-message = "unittest2pytest {version}"
-tag-signing = true
+[tool.setuptools_scm]
+version_file = "unittest2pytest/_version.py"
+
diff -ru main/tests/requirements.txt setuptools-scm/tests/requirements.txt
--- main/tests/requirements.txt	2026-04-03 09:12:15.000000000 +0000
+++ setuptools-scm/tests/requirements.txt	2026-04-03 09:12:27.000000000 +0000
@@ -2,9 +2,7 @@
 pytest >= 3.3.0  # Testing framework.
 
 # Helper tools
-zest.releaser # Makes releasing easier
 wheel  # For creating .whl packages in Appveyour to avoid compiling again.
-check-manifest  # Checks MANIFEST.in
 pyroma  # Checks if package follows best practices of Python packaging.
 chardet  # character encoding detector.
 readme  # Check PYPI description.
diff -ru main/unittest2pytest/__init__.py setuptools-scm/unittest2pytest/__init__.py
--- main/unittest2pytest/__init__.py	2026-04-03 09:12:15.000000000 +0000
+++ setuptools-scm/unittest2pytest/__init__.py	2026-04-03 09:12:27.000000000 +0000
@@ -23,4 +23,8 @@
 
 
 __title__ = 'unittest2pytest'
-__version__ = '0.6.dev0'
+
+try:
+    from ._version import version as __version__
+except ImportError:
+    __version__ = "0.0.0.dev0+unknown"
diff -ru main/unittest2pytest.egg-info/PKG-INFO setuptools-scm/unittest2pytest.egg-info/PKG-INFO
--- main/unittest2pytest.egg-info/PKG-INFO	2026-04-03 09:12:21.000000000 +0000
+++ setuptools-scm/unittest2pytest.egg-info/PKG-INFO	2026-04-03 09:12:34.000000000 +0000
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: unittest2pytest
-Version: 0.6.dev0
+Version: 0.6.dev29+gffb31cd3c
 Summary: Convert unittest test-cases to pytest
 Author-email: Hartmut Goebel <h.goebel@crazy-compilers.com>
 License-Expression: GPL-3.0-or-later
@@ -133,6 +133,30 @@
 
 *UNRELEASED*
 
+- Switch from lib2to3 to `fissix <https://github.com/amyreese/fissix>`_,
+  a maintained fork of lib2to3 (`#95`_).
+
+- Add Python 3.13, 3.14, and 3.15 support.
+
+- Migrate packaging from ``setup.py`` to ``pyproject.toml`` with
+  PEP 639 SPDX license metadata (``GPL-3.0-or-later``) (`#96`_).
+
+- Use ``setuptools-scm`` for version management. Versions are now
+  derived from git tags (`#97`_).
+
+- Add ``check_changelog.py`` CI check to enforce changelog entries
+  (`#97`_).
+
+- Gate PyPI publishing on tests passing by merging the release
+  workflow into CI (`#97`_).
+
+- Update installation instructions with ``uv tool install`` (`#92`_).
+
+.. _#92: https://github.com/pytest-dev/unittest2pytest/pull/92
+.. _#95: https://github.com/pytest-dev/unittest2pytest/pull/95
+.. _#96: https://github.com/pytest-dev/unittest2pytest/pull/96
+.. _#97: https://github.com/pytest-dev/unittest2pytest/pull/97
+
 
 0.5
 ---

@graingert graingert force-pushed the setuptools-scm branch 12 times, most recently from aa8b4b7 to 35345b0 Compare April 3, 2026 09:05
- Add setuptools-scm>=8 to build-system requires
- Add [tool.setuptools_scm] with version_file
- Replace hardcoded __version__ with import from generated _version.py
- Remove version from [tool.setuptools.dynamic] (scm provides it)
- Remove MANIFEST.in (setuptools-scm auto-includes git-tracked files)
- Add unittest2pytest/_version.py to .gitignore
- Remove [tool.zest-releaser] from pyproject.toml
- Remove zest.releaser and check-manifest from tests/requirements.txt
- Add make_changelog.py for preparing releases and adding UNRELEASED
- Add check_changelog.py CI check (diffs UNRELEASED against main on
  PRs, verifies version section on tags)
- Add RELEASE_PROCESS.md documenting the tag-based release flow
- Merge deploy workflow into CI: publish is gated on tests passing
- Add MANIFEST.in to exclude dev files from sdist
Update RELEASING.rst with the setuptools-scm tag-based release
process and delete RELEASE_PROCESS.md.
@graingert graingert force-pushed the setuptools-scm branch 2 times, most recently from 4ab127b to 02ccefe Compare April 3, 2026 09:30
@graingert
Copy link
Copy Markdown
Member Author

Setup required before merging

1. Create GitHub environment

Go to Settings → Environments → New environment, name it release.

Optionally add a protection rule requiring approval from maintainers.

2. Configure PyPI trusted publisher

Go to https://pypi.org/manage/project/unittest2pytest/settings/publishing/ and add:

Field Value
Owner pytest-dev
Repository unittest2pytest
Workflow name release.yml
Environment name release

3. Test the workflow

After merging, run:

gh workflow run release.yml -R pytest-dev/unittest2pytest --field version=0.6

@graingert graingert force-pushed the setuptools-scm branch 10 times, most recently from 0b1108f to da4036a Compare April 3, 2026 09:57
@graingert graingert force-pushed the setuptools-scm branch 3 times, most recently from 35739da to f5e8628 Compare April 3, 2026 10:02
Add release.yml workflow that handles the full release:
prepare changelog, commit, tag, build, test, publish to PyPI,
create GitHub release, and start next development cycle.

Move publish jobs out of test.yml (CI only tests now).
Update RELEASING.rst with instructions to run the workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant