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

Automatically build and upload PyPI packages on release #207

Closed
wants to merge 3 commits into from

Conversation

dralley
Copy link
Contributor

@dralley dralley commented Feb 15, 2020

Don't feel obligated to merge this -- we can continue maintaining the package ourselves just fine.

But it would simplify things if the packages were just automatically created and uploaded on every release, especially if we ever start creating binary wheels that would work across different Linux distros (see the discussion here: [0]).

The RPM team or someone from the RPM team would need to be a co-maintainer on the createrepo_c Python package, and add their credentials to the secrets storage on this repository [1]

[0] #145 (comment)
[1] https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets

@dralley
Copy link
Contributor Author

dralley commented Feb 15, 2020

If you're OK with this, I'll make a PR against libcomps as well.

@Conan-Kudo
Copy link
Member

@dralley Wouldn't this be a problem since we can't statically link librpm in, among other things?

@dralley
Copy link
Contributor Author

dralley commented Feb 15, 2020

@Conan-Kudo Well, right now it only builds source distributions. That means you have to have all of the build dependencies installed, but when you install the Python package the build process is entirely automated away. It's somewhat limiting but still better than nothing.

The other form of Python package is a pre-compiled binary "wheel" distribution. I've been working on this for a good part of the afternoon but haven't gotten it working yet. These packages are effectively statically linked although my understanding is that the actual process is a little bit more complex than that.

For the latter kind of package, once I actually get it to work, it would be entirely standalone.

@dralley
Copy link
Contributor Author

dralley commented Feb 15, 2020

To amend my previous comment a bit: you can actually build a binary wheel of createrepo_c just fine... but you can't upload it to PyPI unless you've built it a certain way, that accomplishes the "effectively statically linked" part of what I just mentioned.

To do that, you have to build it on a special platform (manylinux) that is provided as a docker container, and then run a special tool that takes everything it was dynamically linked against and shoves it into the package, and rewrites the binary to accept it. This is the part I haven't gotten to work yet. Hopefully soon.

^ That sounds crazy, but it's the official way of doing things. It's how every compiled package on PyPI (numpy, etc.) can work on any distribution, Fedora, Debian, CentOS, etc...

@dralley dralley force-pushed the master branch 3 times, most recently from f3dae25 to 672a389 Compare February 15, 2020 16:30
@dralley dralley mentioned this pull request Feb 15, 2020
@dralley dralley changed the title Automatically build and upload PyPI packages on release [work-in-progress] Automatically build and upload PyPI packages on release Feb 15, 2020
@dralley
Copy link
Contributor Author

dralley commented Feb 24, 2020

So the wheel-building component of this PR is blocked on a Python ecosystem issue that I (apparently) uncovered: pypa/auditwheel#230

But packaging source distributions on release can still move forwards, if the general principle of this PR is something you are open to.

@dralley dralley force-pushed the master branch 3 times, most recently from c872b60 to 342074c Compare March 12, 2020 18:56
@dralley dralley changed the title [work-in-progress] Automatically build and upload PyPI packages on release Automatically build and upload PyPI packages on release Jul 2, 2020
@dralley
Copy link
Contributor Author

dralley commented Jul 2, 2020

So this works now, the only thing missing is the "secrets" for uploading to PyPI.

@@ -28,6 +28,7 @@ if (NOT SKBUILD)
endif (NOT SKBUILD)

EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's been a while so I don't remember why it was that this was necessary.

@dralley dralley force-pushed the master branch 3 times, most recently from 4bf9a2c to 915604d Compare November 6, 2020 14:09
@dralley dralley force-pushed the master branch 2 times, most recently from d33ed17 to 96aa33e Compare November 9, 2020 17:37
@dralley
Copy link
Contributor Author

dralley commented Nov 9, 2020

This issue is still blocking publishing binary packages: pypa/manylinux#823

However, automating publishing the standard "source distributions" as we are currently doing would work fine, if you're interested in merging this.

@dralley dralley force-pushed the master branch 7 times, most recently from d605c7b to fd5e8b6 Compare November 13, 2020 02:27
@dralley
Copy link
Contributor Author

dralley commented Dec 23, 2020

Recreating this PR from a different local branch.

@dralley dralley closed this Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants