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

package distribution approach #141

Closed
GavinHuttley opened this issue Jul 12, 2019 · 2 comments
Closed

package distribution approach #141

GavinHuttley opened this issue Jul 12, 2019 · 2 comments

Comments

@GavinHuttley
Copy link
Collaborator

Original report by GavinH (Bitbucket: 557058:e40c23e1-e273-4527-a2f8-5de5876e870d, ).


Should we use flit, poetry or neither?

These tools simplify project distribution to pypi. The questions are:

  • do they handle building wheels with compiled code?
  • do they play well with conda?
@GavinHuttley
Copy link
Collaborator Author

Original comment by T La (Bitbucket: 5c73c2a3cfbc206be909a286, ).


The python packaging landscape is quite vast right now, but I found this page quite helpful in answering the above questions: https://realpython.com/pypi-publish-python-package/

Overall, flit is older, poetry is newer, and poetry also functions as a dependency manager. Hence I would lean towards poetry at this stage. Both help with pypi distribution, but can’t help with conda distribution. That said, I currently don’t see why it would be incompatible with conda distribution (via another means, namely the conda upload instructions in #142).

do they handle building wheels with compiled code?

According to the site, “Flit doesn’t support advanced packages like those creating C extensions”. From my brief google searching, I couldn’t find any hits for flit supporting C extensions (which I’m assuming is what is meant by “compiled code”).

Poetry seems to support it as indicated by python-poetry/poetry#11. See sdispater’s response for a working example:


Yes, it works even though it's not currently documented because I do not know if it will stay this way since it relies on adding kwargs to the setup.py.

Anyway, it you want to test this, you have to specifiy a build script in your pyproject.toml:

[tool.poetry]
build = 'build.py'

that will define a build function that will add the necessary build keyword arguments to the call to setup() in the generated setup.py.

-sdispater


do they play well with conda?

They won’t help upload the project to conda, but we might and should be able to follow the conda instructions in #142 without flit or poetry interfering.

@GavinHuttley
Copy link
Collaborator Author

Original comment by GavinH (Bitbucket: 557058:e40c23e1-e273-4527-a2f8-5de5876e870d, ).


Research done, opening a new ticket for the next step.

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

No branches or pull requests

1 participant