-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
What can I do to help make PyPi publications a reality? #4507
Comments
Hi @mikeholler, I'm the Python maintainer. We've let releases lag, since 1) it seems users typically end up pulling from master, and 2) some changes should bump the Python package version even if they aren't a change to the FlatBuffers core code, and we have not explicitly decided how to handle that case. Ideally, we'd ship a new Python package at least as often as core FlatBuffers does. To answer your questions:
|
Hey @rw thanks for responding! I'm playing around with Travis on my fork and am making some progress towards publication when a new tag is pushed. I found a blocker for an issue I logged here: travis-ci/travis-ci#8801 I'll give them a chance to respond, and if they don't get back in a reasonable amount of time I'll try to hack at it myself. |
It is confusing to see the github version number lower than pypi version. Glad to see this is going to be fixed soon! |
FYI I've seen other big projects that support multiple languages and use PyPi put setup.py in the root directory without issue. One example I can think of off the top of my head is https://github.com/bulletphysics/bullet3 and its pypi package pybullet. |
What happened to this. Looks like there is potential for pypi ci/cd but it isn't enabled? |
Please do this, it's not that straightforward to depend on git and pip will yell at you anyway. |
I'm a bit new to pip, so just to make sure I understand--the current guidance is to use a github url in my setup.py dependency_links, and then tell all my clients to use And the aforementioned pip yelling is because that flag is deprecated, so this strategy may break at some point? pypa/pip#4187 That puts me in such a compromising position that I might consider copying the flatbuffers source into my own repo and that's pretty gross. Would you consider doing a manual publication for each tagged release until you figure out your automation? Considering that you've only had one release so far in 2018, that doesn't strike me as unduly burdensome. |
@vishvananda We have some Python related CI in travis.yml, but it's not enabled because it currently fails (intermittently I think). If someone knows how to make it robust we can enable it. @tarehart I can totally make a manual release.. if someone would spell out the incantations to me that would be appreciated, since I'm not that familiar with the Python ecosystem. Better yet if @rw or someone else can do it since I didn't even set up the original. |
Thanks, that would be great! I believe the instructions here are accurate and appropriate for your code: https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project |
Here are the steps, generally:
You can do a simple smoke test into a virtualenv before uploading (and use this virtualenv to install twine).
Once that's done, do the twine upload command, provide your credentials and you're done. |
Ok, it has been uploaded.. but it still defaults to showing the 2015 version by default, because of the naming? There appears to be no way to change that. |
Yeah, it's probably because of the naming. I guess people who just do |
You can hide the old versions I think. It's probably parsing the version string as a tuple of integers, and 2015 > 1. |
There are only options for delete (which would probably be a bad idea), not hide. Would be good to fix this, as this could have a lot of people thinking the old versions are current, and then going thru the pain of finding out stuff doesn't work. Kinda surprised pypi has no way to fix this. |
I'm getting some odd behavior when trying to install 1.9 via pip:
When using This does not seem to be fatal, but I'm worried about hidden consequences in the future. Is it possible something went awry with the versioning? |
No, the problem is the setup.py is set up to try to fish out the version from an environment variable (and from the date when that fails) when it's run, and it gets run when you install the default type of Python package (a source distribution, what we're uploading). That's simply how Python packages work. There is another kind of Python package called a wheel. They are a little different in that no code gets run when you install from a wheel, just files get copied. (They can also be platform-specific and contain binary code for their platforms, that's how you can for example install numpy on Windows/macOS/Linux without a compiler. But that's beside the point.) The downside of wheels is you need a slightly newer pip version to install them. But they have existed for a long time now so I don't think that's an issue any more. Would you like instructions on how to build a wheel (it's very similar)? We can have both wheels and sdists (.tar.gz) up on PyPI at the same time. |
@Tinche sure. Can future releases then be wheel-only? Does publishing a wheel do anything to correct the current mess? |
To build a wheel, it is almost the same thing as building a source package like you did a few days ago: you just have to run Be aware that wheels are dependent on the python version you use: if you create it using python 3, it will works on python 3 only (same thing for python 2). So if you want flatbuffers to be compatible with python 2 and python 3, you have to create a wheel using python 3 and then do the same thing using python 2. You can release only wheels, but it is recommended by pypi to also release a source package to be compatible with old pip versions (that don't handle wheels).
Publishing a wheel won't do anything to correct the current mess because it will be added to the "1.9" version on the Pypi repo. I think the best way to clear it, is to download the old versions, remove them from pypi and reupload them with a |
Sorry, I didn't have the time to respond until now. Adding to what haroal wrote, you will need to If you create a setup.cfg file next to setup.py and put this in it:
you will create a universal wheel (both Py2 and Py3). Then you can upload just that. I think uploading wheels will actually solve the version thing, but we should test it out beforehand. The current problem is that executing setup.py reads or generates the version when it's run, and source distributions work by running the setup.py both when building the distribution and when installing it. Wheels gets their version during building and put it metadata.json inside the archive. Here's a way to test. Generate both a sdist and a wheel. Then remove the
Now for the wheel:
|
Thanks for the guidance, got as far as:
|
(and haven't uploaded the .whl yet) |
did you see the comment about running |
@vishvananda yes, I got:
I guess I also need to do this in the virtual env.. that wasn't obvious to me :) |
Ok, getting similar output to you, |
Ok, uploaded. |
To commemorate the 1.10.0 releases I am doing right now, I also deleted the old releases from 2015 that kept showing up on pypi as most recent: https://pypi.org/manage/project/flatbuffers/releases/ I know I am potentially breaking people, but it didn't seem like there were any other options. |
Are flatbuffer releases cross version compatible? E.g., can a flatbuffer written by version 1.10 be read by version 2015.*? |
@amiralia Yes, FlatBuffers are both forward and backwards compatible between the earliest releases and the latest versions, of all languages. |
This issue has been automatically marked as stale because it has not had activity for 1 year. It will be automatically closed if no further activity occurs. To keep it open, simply post a new comment. Maintainers will re-open on new activity. Thank you for your contributions. |
It looks like you guys are publishing again, so time to close this. @aardappel I will say I think deleting artifacts from PyPi is a horrible idea. That kind of action is how the leftpad incident occurred. The storage on PyPi is free, so was it just aesthetic reasons you deleted it? I really don't mind old and weird numbered versions being present in an artifact repository, in fact, I really would hope they stay there forever. I'm glad non of the software we use seems to be transitively affected by this decision (we wouldn't have had a direct problem with it, since we've moved far away from that version, and besides host our own lazy caches). |
Hey there,
Thanks for such a great tool. As I'm sure you're aware, the PyPi repository for flatbuffers is rather out of date. I would like to change this. What can I do to help you guys get builds published for each release?
We have some information in #4390 provided by @kbrose, but so far it looks like nobody has taken the initiative to make this process more continuous.
Some questions:
Happy Thanksgiving!
Mike
The text was updated successfully, but these errors were encountered: