Skip to content

setup.cfg: set version using platformdirs.__version__ - #34

Closed
tchaikov wants to merge 1 commit into
tox-dev:mainfrom
tchaikov:add-version-to-setup.cfg
Closed

tchaikov wants to merge 1 commit into
tox-dev:mainfrom
tchaikov:add-version-to-setup.cfg

Conversation

@tchaikov

@tchaikov tchaikov commented Aug 3, 2021

Copy link
Copy Markdown

otherwise the generated PKG-INFO would contain a version of "0.0.0"

Signed-off-by: Kefu Chai [email protected]

otherwise the generated PKG-INFO would contain a version of "0.0.0"

Signed-off-by: Kefu Chai <[email protected]>
@gaborbernat

Copy link
Copy Markdown
Member

This is only true if you don't satisfy the build dependencies, but then you're violating Python packaging requirements.

@tchaikov

tchaikov commented Aug 3, 2021

Copy link
Copy Markdown
Author

thank you Bernát for the quick review. yeah, i think i just failed to install setuptools_scm beforehands.

@ofek

ofek commented Aug 3, 2021

Copy link
Copy Markdown
Collaborator

@tchaikov How did you install platformdirs? I'd like to better understand situations in which build dependencies are unmet.

@tchaikov

tchaikov commented Aug 3, 2021 •

Copy link
Copy Markdown
Author

@ofek hello Ofek! sorry for the text wall. tl;dr: it's a story of a lazy RPM packager.

i am trying to package python-virtualenv v20.6.0 on RHEL9. and it turns out it requires python3-platformdirs to build. so i moved on to python-platformdirs. fortunately, this package was already packaged [0] by fedora. but unfortunately, the fedora packaging maintainer uses the pyproject_buildrequires[1] rpm macro to collect the build dependencies of python-platformdirs package in the RPM spec file. this macro does its job[2] just fine. but i ran into two issues:

  1. the package offering this macro is not yet packaged in EPEL repo.
  2. one of the dependencies,python3-setuptools_scm, is not available in EPEL, and it depends on mercurial!

instead of diving into this rabbit hole, i cowardly manually translated the build dependencies defined by pyproject.toml to the BuildRequires lines in rpm spec, and dropped python3-setuptools_scm in hope that i could get away without it..

and i built platformdirs using

python3 setup.py  bdist_wheel

this was what i got using %py3_build_wheel RPM macro.

and installed it using

python3 -m pip install -I dist/platformdirs-*-py3-none-any.whl \
  --root /home/kchai/rpmbuild/BUILDROOT/platformdirs-2.2.0-1.x86_64 \
  --strip-file-prefix /home/kchai/rpmbuild/BUILDROOT/platformdirs-2.2.0-1.x86_64 \
  --no-deps

this was what i got using '%py3_install_wheel'. i guess it was --no-deps which ignores the required dependencies. this macro is defined by https://src.fedoraproject.org/rpms/python-rpm-macros/blob/rawhide/f/macros.python3#_56 . guess the author of the macro believes that maintainers should do the right thing instead of cutting the corner like me =(..


[0] https://src.fedoraproject.org/rpms/pyproject-rpm-macros/branches?branchname=rawhide
[1] https://src.fedoraproject.org/rpms/python-platformdirs/blob/rawhide/f/python-platformdirs.spec#_32
[2] https://src.fedoraproject.org/rpms/pyproject-rpm-macros/blob/rawhide/f/pyproject_buildrequires.py#_184

@RonnyPfannschmidt

Copy link
Copy Markdown

its unfortunate that setuptools_scm is packaged incorrectly
mercurial is by no means a hard dependency

@tchaikov

tchaikov commented Aug 3, 2021

Copy link
Copy Markdown
Author

ahh, it is not a hard dependency. see https://src.fedoraproject.org/rpms/python-setuptools_scm/blob/rawhide/f/python-setuptools_scm.spec#_18

i will try again with "tests" disabled.

gaborbernat added a commit that referenced this pull request Oct 27, 2026
Moves every
[`tox-dev/github-workflows`](https://github.com/tox-dev/github-workflows)
pin to
[6.2.0](https://github.com/tox-dev/github-workflows/releases/tag/6.2.0).
👋 The GitHub Release now credits first-time contributors: the publish
step takes the New Contributors list from GitHub's generated notes for
the range since the previous tag and places it above the package and
comparison links
([#34](tox-dev/github-workflows#34)). The
changelog file no longer carries that list.

The pins also pick up the 6.0.2 to 6.1.0 changes: release asset names
match the names GitHub stores
([#29](tox-dev/github-workflows#29)), and the
rendered notes list several packages on one row with an ecosystem emoji
([#32](tox-dev/github-workflows#32)).
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.

4 participants