-
Notifications
You must be signed in to change notification settings - Fork 7
pyproject.toml: fix missing package i wheel #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
Can you explain more? I tested this just now and can't replicate what you are referring to. When I install the package, I see a standard package directory in my virtual environment. Here's the output from a fresh install of
|
It might have something to do with versions of the software. I do not see a version of you hatchling, but mine is the latest 1.27.0.
I have newer Python, newer hatchling, newer pip. I suspect that something changed between those versions. The change matches suggested usage from the hatchling documentation, and thus, I think that it is a good way forward. I am not knowledgeable enough in hatchling to know why you don't see the same result as I do. |
One difference I see is that the method you showed is installing from a local clone while I'm installing from PyPI. Speculating, that might be because the tools expect someone to be editing the local install so code from the package is not put in the virtual environment. If you install from PyPI, do you see different behavior from what I do? Until I can observe that something is wrong with the official package available on PyPI, I'm not inclined to take this change (even though I respect your intentions). |
Yes, the wheel downloaded from pypi is correct. The issue is if you generate a wheel with
That is not the only distribution. You can also install from source, and in the case of Nixpkgs, it is even the preferred way. Honestly, I have no idea why this fixes the issue. I just copied the following section https://hatch.pypa.io/latest/config/build/#packages. As I stated, I do not have experience with hatchling. If you think that it is rather a hatchling error instead of an error in your usage of hantchling, then feel free to not merge this, but trust me, there is some issue there.
|
I did some digging and found this: pypa/hatch#1947. It is about an editable package, but it states some special rules for the |
Hi, I have been trying to package pytest-tap for debian bookworm (a couple of backports from debian trixie were required for hatchling, etc.) and have encountered the issue that the buildsystem is producing an empty wheel file. The change introduced by @Cynerd would fix this issue. This package from what I have understood so far can not be packaged to debian without this change being introduced. Would be nice to introduce this change. |
I gave this another look. Running against the test suite, this change fails. Sorry for not having CI set up to run on PRs (that's corrected now and you can see the results in #106 ). Here's what happens with that change. With this change, the package includes no files. Until this can be reconciled, I can't accept this change as is.
|
I ended up just introducing an patch to my debian packaging. If anyone struggles to build a local wheel with |
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:
The listed directory wasn't present before this change.
To accept your contribution, please complete the checklist below.
Did you write a test to verify your code change?does not apply