Skip to content

Conversation

@ArmandBENETEAU
Copy link
Contributor

This little "cleaning" of the 'pyproject.toml' file allows to build correctly the python wheel file in two different ways:

  • uv build
  • python3 -m pip wheel .

Previously, only the uv build command worked. However it seems that the python packaging macros ("%pyproject_wheel" for RPM for example) use the python3 -m pip wheel . command.

Thanks to this modification, both cases are working.

To accept your contribution, please ensure that the checklist below is complete.

  • Is your name/identity in the AUTHORS file?
  • Does the code change (if the PR contains code) have 100% test coverage?
  • Is CI passing all quality and testing checks?

This little "cleaning" of the 'pyproject.toml' file allows to build
correctly the python wheel file in two different ways:

- `uv build`
- `python3 -m pip wheel .`

Previously, only the `uv build` command worked. However it seems that
the python packaging macros ("%pyproject_wheel" for RPM for example) use
the `python3 -m pip wheel .` command.

Thanks to this modification, both cases are working.

Signed-off-by: Armand Bénéteau <armand.beneteau@iot.bzh>
@ArmandBENETEAU
Copy link
Contributor Author

If this PR is accepted, it solves the issue #165 by the way the same fix can be applied in pytest-tap. Tell me if you want me to create the same PR for it.

Copy link
Member

@mblayman mblayman left a comment

Choose a reason for hiding this comment

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

CI passed and inspected this locally and it works. Thanks!

I don't understand why this works and using sources does not, but whatever. 🤷

LGTM

@mblayman mblayman merged commit 34b3743 into python-tap:main Oct 30, 2025
17 checks passed
mblayman added a commit to Cynerd/pytest-tap that referenced this pull request Oct 30, 2025
mblayman added a commit to python-tap/pytest-tap that referenced this pull request Oct 30, 2025
* pyproject.toml: fix missing package i wheel

The wheel was missing package due to it not being packaged. The
hatchling documentation specifies that packages should be set this way.

The testing of this change in virtual environment:

  nobody@host:pytest-tap$ python3 -m venv env                                                                                                         wheelfix+
  nobody@host:pytest-tap$ . ./env/bin/activate                                                                                                        wheelfix+
  ((env) ) nobody@host:pytest-tap$ pip install .                                                                                                      wheelfix+
  Processing /home/cynerd/src/pytest-tap
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Preparing metadata (pyproject.toml) ... done
  Requirement already satisfied: pytest>=3.0 in /nix/store/094gpcj7d1z8wdvymhxvi2rns757vb2p-python3.12-pytest-8.3.5/lib/python3.12/site-packages (from pytest-tap==3.5) (8.3.5)
  Requirement already satisfied: tap-py<4.0,>=3.2 in /nix/store/bmvj5dimxkphyrzwl0jyvi6blz8imqpn-python3.12-tap.py-3.2.1/lib/python3.12/site-packages (from pytest-tap==3.5) (3.2.1)
  Requirement already satisfied: iniconfig in /nix/store/8bcr5c5m8d1359k52mwjdbqjw2rzwdgq-python3.12-iniconfig-2.1.0/lib/python3.12/site-packages (from pytest>=3.0->pytest-tap==3.5) (2.1.0)
  Requirement already satisfied: packaging in /nix/store/wr2lp9ziysxbjbf5ww09a4k7ivvnxbc4-python3.12-packaging-24.2/lib/python3.12/site-packages (from pytest>=3.0->pytest-tap==3.5) (24.2)
  Requirement already satisfied: pluggy<2,>=1.5 in /nix/store/fbbyfni2ccjw8r7rh7ww3x8ky1yk4hi7-python3.12-pluggy-1.5.0/lib/python3.12/site-packages (from pytest>=3.0->pytest-tap==3.5) (1.5.0)
  Building wheels for collected packages: pytest-tap
    Building wheel for pytest-tap (pyproject.toml) ... done
    Created wheel for pytest-tap: filename=pytest_tap-3.5-py3-none-any.whl size=6543 sha256=6733459ec7272402507031361355d4820fd799659e4102568790d9e53b2863c0
    Stored in directory: /home/cynerd/.cache/pip/wheels/e4/ea/6f/0c79e4850b81f185670c0a561a2ebc457c7a0b4ee105c88476
  Successfully built pytest-tap
  Installing collected packages: pytest-tap
  Successfully installed pytest-tap-3.5

  [notice] A new release of pip is available: 25.0.1 -> 25.1.1
  [notice] To update, run: pip install --upgrade pip
  ((env) ) nobody@host:pytest-tap$ ls env/lib/python3.12/site-packages/pytest_tap/                                                                    wheelfix+
  __init__.py  plugin.py

The listed directory wasn't present before this change.

* Remove sources entry from pyproject.toml

This applies a similar fix to python-tap/tappy#166

---------

Co-authored-by: Matt Layman <matthewlayman@gmail.com>
@ArmandBENETEAU
Copy link
Contributor Author

Honestly, even after reading the documentation I am not sure why it is working. I've just seen that in the example given here, there is no "sources" entry in the [tool.hatch.build.targets.sdist] part... So I tried it and it worked!

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.

2 participants