Skip to content

Conversation

@branchvincent
Copy link
Contributor

Fixes #29

Reading the version from the environment does introduce inconsistent versions, causing pip check to fail and even prevents uv from installing at all:

$ uv venv
$ uv pip install --no-binary=pycomposefile pycomposefile
  × Failed to download and build `pycomposefile==0.0.32`
  ╰─▶ Package metadata version `0.0.1a1` does not match given version `0.0.32`

Instead, this simply embeds the version in the sdist (example workflow run). Also, I took the opportunity to migrate to pyproject.toml, the modern replace for setup.py favoring static metatdata. To check the difference between the two builds:

$ uv build -o /tmp/before
$ git switch fix-version && uv build -o /tmp/after
$ uvx diffoscope --exclude-directory-metadata=recursive /tmp/before/*.tar.gz /tmp/after/*.tar.gz

@usepowershell usepowershell requested a review from Copilot July 21, 2025 18:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses version inconsistency issues by embedding the version directly in the sdist and modernizes the build configuration. The change fixes problems where dynamic version reading from environment variables caused pip check to fail and prevented uv from installing the package due to version mismatches.

  • Migrates from setup.py to modern pyproject.toml configuration with static metadata
  • Replaces dynamic environment-based versioning with sed-based version injection in CI
  • Switches build system from setuptools to flit_core

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/setup.py Removes legacy setuptools configuration file
src/pyproject.toml Adds modern Python packaging configuration with static metadata
.github/workflows/publish.yaml Updates CI to use sed for version injection instead of environment variables

@branchvincent
Copy link
Contributor Author

hi @smurawski, should I fix the unrelated lint error in this PR? (might be good to add 3.13 to ci as well)

@usepowershell
Copy link
Owner

hi @smurawski, should I fix the unrelated lint error in this PR? (might be good to add 3.13 to ci as well)

That would be fantastic. Then I'll get this merged and shipped. Sorry for the delay in initially getting to this.

@branchvincent
Copy link
Contributor Author

No worries, this should be ready now

@usepowershell usepowershell merged commit 9cdc89f into usepowershell:main Jul 24, 2025
4 checks passed
@branchvincent branchvincent deleted the fix-version branch July 26, 2025 03:52
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.

Incorrect version number in setup.py

2 participants