Skip to content
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

Proper way of building a wheel file from sources #626

Closed
jose1711 opened this issue Nov 2, 2022 · 11 comments · Fixed by #627
Closed

Proper way of building a wheel file from sources #626

jose1711 opened this issue Nov 2, 2022 · 11 comments · Fixed by #627
Labels

Comments

@jose1711
Copy link

jose1711 commented Nov 2, 2022

Please what I am doing wrong here trying to build .whl from sources:

$ cd syrupy-3.0.2
$ python -m build --wheel
* Creating venv isolated environment...
* Installing packages in isolated environment... (poetry-core>=1.1.0b3)
* Getting build dependencies for wheel...
* Building wheel...
Successfully built syrupy-3.0.2-py3-none-any.whl

No errors but the generated file is rather incomplete and contains just a single py.typed file:

$ unzip -l dist/syrupy-3.0.2-py3-none-any.whl
Archive:  dist/syrupy-3.0.2-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  1980-01-01 00:00   syrupy/py.typed
       26  2016-01-01 00:00   syrupy-3.0.2.dist-info/entry_points.txt
    10769  1980-01-01 00:00   syrupy-3.0.2.dist-info/LICENSE
       88  2016-01-01 00:00   syrupy-3.0.2.dist-info/WHEEL
    24400  2016-01-01 00:00   syrupy-3.0.2.dist-info/METADATA
      455  2016-01-01 00:00   syrupy-3.0.2.dist-info/RECORD
---------                     -------
    35738                     6 files

Thank you for your time.

@noahnu
Copy link
Collaborator

noahnu commented Nov 2, 2022

What's the reason for building from sources like this? If developing in the project, we have a pyinvoke command for building. Should be called out in the contributing guide. Some of the complexity comes from using poetry.. since setup tools added pyproject toml support, I may switch back to that.

@jose1711
Copy link
Author

jose1711 commented Nov 2, 2022

Just trying to determine why syrupy's PKGBUILD in AUR is not doing the right job (the issue was not in the source url).

@noahnu
Copy link
Collaborator

noahnu commented Nov 2, 2022

Oh interesting. I wasn't aware of this distribution. I can take a look in the next couple days.

@alan1world
Copy link

This line needs to be changed from
include = ['src/syrupy/py.typed']
to

include = ['src/syrupy/**/*']

Hence only the single py.typed'file is appearing.
Arch will then be able to build the whl correctly.

@noahnu
Copy link
Collaborator

noahnu commented Nov 3, 2022

Feel free to put up a PR, otherwise will get to this shortly. #627

@noahnu
Copy link
Collaborator

noahnu commented Nov 3, 2022

Worth noting that poetry's build seems to be working via poetry build. It includes the relevant files. So I imagine it's interpreting "include" differently than "build".

@noahnu
Copy link
Collaborator

noahnu commented Nov 3, 2022

https://python-poetry.org/docs/pyproject/#include-and-exclude

From the examples, it looks like you only need to include the "extra" files not included from the packages directive. Note that this "include" is under tool.poetry so it should be interpreted by poetry or according to poetry's spec.

That being said if the more expansive glob wildcard works, I don't have any objection to it.

@tophat-opensource-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 3.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@noahnu
Copy link
Collaborator

noahnu commented Nov 3, 2022

Does anyone know how the package was submitted to arch linux? If it was manually submitted, this would be good to add to our github workflow on continuous deployment

@carlosal1015
Copy link

carlosal1015 commented Nov 3, 2022

Hi @noahnu the package was updated.

If want add support for Arch Linux through GitHub actions. It is possible to follow this approach or eventually any of Arch Users here we can make a pull request.

Edited. I am not sure if the question is like developers use twine with authentication to publish to Pypi. There are ways to publish to AUR. Examples here and here.

@noahnu
Copy link
Collaborator

noahnu commented Nov 4, 2022

Let's continue the discussion in #632

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants