Skip to content

Conversation

@1fanwang
Copy link
Contributor

@1fanwang 1fanwang commented May 5, 2025

closes #210, #191, #154
@oittaa
cc @BenediktBurger @andrewzah

This PR modernizes the package configuration by:
Issue originated from unblocking enterprise adoption of Airflow 3.0 which depends on this package apache/airflow#43243

Requested uuid6===2024.7.10 from https://files.pythonhosted.org/packages/2c/56/2560a9f1ccab9e12b1b3478a3c870796cf4d8ee5652bb19b61751cced14a/uuid6-2024.7.10.tar.gz#sha256=2d29d7f63f593caaeea0e0d0dd0ad8129c9c663b29e19bdf882e864bedf18fb0 has inconsistent version: expected '2024.7.10', but metadata has '0.0.0.dev0' ERROR: Could not find a version that satisfies the requirement uuid6===2024.7.10
  1. Moving to pyproject.toml as recommended by PyPA
  2. Implementing automatic version detection with setuptools_scm (proposing switching to semantic versioning as opposed to CalVer, starting with a git tag 2025.0.0)
  3. Preparing for transition to Semantic Versioning
  4. Adding versioning documentation to README.md
  5. Updating GitHub Actions workflow for the new build system

Ref
https://packaging.python.org/en/latest/tutorials/packaging-projects/
https://peps.python.org/pep-0621/
https://packaging.python.org/en/latest/tutorials/packaging-projects/#configuring-metadata
https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/

Changes

  • Replaced setup.py with pyproject.toml for packaging configuration
  • Added setuptools_scm for automatic version management from Git tags
  • Updated GitHub Actions workflow to support setuptools_scm
  • Added version handling in __init__.py to expose package version
  • Added versioning documentation to README

Testing

  • Built and tested package locally with setuptools_scm
(venv) (base) ➜  uuid6-python git:(1fanwang/fix-packaging) ✗ git tag 2025.0.0
(venv) (base) ➜  uuid6-python git:(1fanwang/fix-packaging) ✗ python -c "from setuptools_scm import get_version; print(get_version())"
2025.0.1.dev0+g9129b99.d20250505
(venv) (base) ➜  uuid6-python git:(1fanwang/fix-packaging) ✗ python -m build
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - setuptools>=45
  - setuptools_scm[toml]>=6.2
  - wheel
* Getting build dependencies for sdist...
  corresp(dist, value, root_dir)
  dist._finalize_license_expression()
  self._finalize_license_expression()
running egg_info
writing src/uuid6.egg-info/PKG-INFO
writing dependency_links to src/uuid6.egg-info/dependency_links.txt
writing top-level names to src/uuid6.egg-info/top_level.txt
adding license file 'LICENSE'
writing manifest file 'src/uuid6.egg-info/SOURCES.txt'
* Building sdist...
  corresp(dist, value, root_dir)
  dist._finalize_license_expression()
  self._finalize_license_expression()
running sdist
running egg_info
writing src/uuid6.egg-info/PKG-INFO
writing dependency_links to src/uuid6.egg-info/dependency_links.txt
writing top-level names to src/uuid6.egg-info/top_level.txt
adding license file 'LICENSE'
writing manifest file 'src/uuid6.egg-info/SOURCES.txt'
running check
creating uuid6-2025.0.1.dev0+g9129b99.d20250505
creating uuid6-2025.0.1.dev0+g9129b99.d20250505/.github
creating uuid6-2025.0.1.dev0+g9129b99.d20250505/.github/workflows
creating uuid6-2025.0.1.dev0+g9129b99.d20250505/.vscode
creating uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6
creating uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6.egg-info
creating uuid6-2025.0.1.dev0+g9129b99.d20250505/test
copying files to uuid6-2025.0.1.dev0+g9129b99.d20250505...
copying .editorconfig -> uuid6-2025.0.1.dev0+g9129b99.d20250505
copying .flake8 -> uuid6-2025.0.1.dev0+g9129b99.d20250505
copying .gitignore -> uuid6-2025.0.1.dev0+g9129b99.d20250505
copying LICENSE -> uuid6-2025.0.1.dev0+g9129b99.d20250505
copying README.md -> uuid6-2025.0.1.dev0+g9129b99.d20250505
copying bench.sh -> uuid6-2025.0.1.dev0+g9129b99.d20250505
copying pyproject.toml -> uuid6-2025.0.1.dev0+g9129b99.d20250505
copying requirements-dev.txt -> uuid6-2025.0.1.dev0+g9129b99.d20250505
copying .github/dependabot.yml -> uuid6-2025.0.1.dev0+g9129b99.d20250505/.github
copying .github/workflows/main.yml -> uuid6-2025.0.1.dev0+g9129b99.d20250505/.github/workflows
copying .github/workflows/publish-to-test-pypi.yml -> uuid6-2025.0.1.dev0+g9129b99.d20250505/.github/workflows
copying .vscode/settings.json -> uuid6-2025.0.1.dev0+g9129b99.d20250505/.vscode
copying src/uuid6/__init__.py -> uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6
copying src/uuid6/py.typed -> uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6
copying src/uuid6.egg-info/PKG-INFO -> uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6.egg-info
copying src/uuid6.egg-info/SOURCES.txt -> uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6.egg-info
copying src/uuid6.egg-info/dependency_links.txt -> uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6.egg-info
copying src/uuid6.egg-info/top_level.txt -> uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6.egg-info
copying test/__init__.py -> uuid6-2025.0.1.dev0+g9129b99.d20250505/test
copying test/test_uuid6.py -> uuid6-2025.0.1.dev0+g9129b99.d20250505/test
copying test/test_vectors.py -> uuid6-2025.0.1.dev0+g9129b99.d20250505/test
copying src/uuid6.egg-info/SOURCES.txt -> uuid6-2025.0.1.dev0+g9129b99.d20250505/src/uuid6.egg-info
Writing uuid6-2025.0.1.dev0+g9129b99.d20250505/setup.cfg
Creating tar archive
removing 'uuid6-2025.0.1.dev0+g9129b99.d20250505' (and everything under it)
* Building wheel from sdist
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - setuptools>=45
  - setuptools_scm[toml]>=6.2
  - wheel
* Getting build dependencies for wheel...
  corresp(dist, value, root_dir)
  dist._finalize_license_expression()
  self._finalize_license_expression()
running egg_info
writing src/uuid6.egg-info/PKG-INFO
writing dependency_links to src/uuid6.egg-info/dependency_links.txt
writing top-level names to src/uuid6.egg-info/top_level.txt
ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
reading manifest file 'src/uuid6.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'src/uuid6.egg-info/SOURCES.txt'
* Building wheel...
/private/var/folders/80/1b293mrs1fb5tgbn75bt745800203f/T/build-env-0ox5j5_7/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
  corresp(dist, value, root_dir)
  dist._finalize_license_expression()
  self._finalize_license_expression()
running bdist_wheel
running build
running build_py
creating build/lib/uuid6
copying src/uuid6/__init__.py -> build/lib/uuid6
running egg_info
writing src/uuid6.egg-info/PKG-INFO
writing dependency_links to src/uuid6.egg-info/dependency_links.txt
writing top-level names to src/uuid6.egg-info/top_level.txt
ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
reading manifest file 'src/uuid6.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'src/uuid6.egg-info/SOURCES.txt'
copying src/uuid6/py.typed -> build/lib/uuid6
installing to build/bdist.macosx-11.1-arm64/wheel
running install
running install_lib
creating build/bdist.macosx-11.1-arm64/wheel
creating build/bdist.macosx-11.1-arm64/wheel/uuid6
copying build/lib/uuid6/__init__.py -> build/bdist.macosx-11.1-arm64/wheel/./uuid6
copying build/lib/uuid6/py.typed -> build/bdist.macosx-11.1-arm64/wheel/./uuid6
running install_egg_info
Copying src/uuid6.egg-info to build/bdist.macosx-11.1-arm64/wheel/./uuid6-2025.0.1.dev0+g9129b99.d20250505-py3.12.egg-info
running install_scripts
creating build/bdist.macosx-11.1-arm64/wheel/uuid6-2025.0.1.dev0+g9129b99.d20250505.dist-info/WHEEL
creating '/Users/stewang/workspace/uuid6-python/dist/.tmp-dywr96nd/uuid6-2025.0.1.dev0+g9129b99.d20250505-py3-none-any.whl' and adding 'build/bdist.macosx-11.1-arm64/wheel' to it
adding 'uuid6/__init__.py'
adding 'uuid6/py.typed'
adding 'uuid6-2025.0.1.dev0+g9129b99.d20250505.dist-info/licenses/LICENSE'
adding 'uuid6-2025.0.1.dev0+g9129b99.d20250505.dist-info/METADATA'
adding 'uuid6-2025.0.1.dev0+g9129b99.d20250505.dist-info/WHEEL'
adding 'uuid6-2025.0.1.dev0+g9129b99.d20250505.dist-info/top_level.txt'
adding 'uuid6-2025.0.1.dev0+g9129b99.d20250505.dist-info/RECORD'
removing build/bdist.macosx-11.1-arm64/wheel
Successfully built uuid6-2025.0.1.dev0+g9129b99.d20250505.tar.gz and uuid6-2025.0.1.dev0+g9129b99.d20250505-py3-none-any.whl
(venv) (base) ➜  uuid6-python git:(1fanwang/fix-packaging) pip install .                                 
Processing /Users/stewang/workspace/uuid6-python
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: uuid6
  Building wheel for uuid6 (pyproject.toml) ... done
  Created wheel for uuid6: filename=uuid6-2025.0.1.dev1+g5a9669b-py3-none-any.whl size=7155 sha256=abdfe681746116aaa5252841bce2f8edb31f4d7e9776f8773a9ed2ae1f0f9682
  Stored in directory: /Users/stewang/Library/Caches/pip/wheels/a3/d7/06/6327bdbf50579d39c5b877165f5a8eb1d0dd95ea9d0ca3c4ef
Successfully built uuid6
Installing collected packages: uuid6
  Attempting uninstall: uuid6
    Found existing installation: uuid6 0.1.dev147+g9129b99.d20250505
    Uninstalling uuid6-0.1.dev147+g9129b99.d20250505:
      Successfully uninstalled uuid6-0.1.dev147+g9129b99.d20250505
Successfully installed uuid6-2025.0.1.dev1+g5a9669b

[notice] A new release of pip is available: 24.3.1 -> 25.1.1
[notice] To update, run: pip install --upgrade pip

@1fanwang
Copy link
Contributor Author

1fanwang commented May 5, 2025

hey @oittaa could you help review this PR when you get a chance? Thanks a lot

Airflow OSS depends on https://pypi.org/project/uuid6/ and the inconsistent package metadata from uuid6 causes package installation to fail within enterprise environments as detailed in #210

@oittaa
Copy link
Owner

oittaa commented Jun 11, 2025

Thanks! Let's see how it goes.

@oittaa oittaa merged commit c71bfb4 into oittaa:main Jun 11, 2025
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.

Package Version (2024.7.10) has inconsistent version metadata causing installation failures

2 participants