-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Created the GitHub Actions step Upload to PyPi #535
Conversation
cb015f2
to
069cc11
Compare
Thanks! This will be really great to have. One use case I can think of (besides mine, which is loading complex html and css into my card templates) is that now Anki addon authors might have an easier time running automated tests for them against a variety of Anki releases. |
@@ -1,3 +1,5 @@ | |||
#!/usr/bin/env python3 | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hasnt utf8 been the default for a long time now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edition = "2018" | ||
authors = ["Ankitects Pty Ltd and contributors"] | ||
authors = ["Ankitects Pty Ltd and contributors <[email protected]>"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this mail address here intended? I'd expect this to rather point to Anki support page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know any anki support email and pypi is rejecting the wheel if there is no email.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dae, is there an email for support?
edition = "2018" | ||
authors = ["Ankitects Pty Ltd and contributors"] | ||
authors = ["Ankitects Pty Ltd and contributors <[email protected]>"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Evandro, on the whole it looks good; I've made some comments below.
pylib/setup.py
Outdated
version = fh.read().strip() | ||
minimum_python_version = (3, 7) | ||
|
||
if sys.version_info < minimum_python_version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the point of this, as we care about install-time checks, and that should already be covered by python_requires below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see that. I Removed it.
.build/vernum: ../meta/version | ||
sed -i.bak 's/.*automatically updated.*/ version="$(VER)", # automatically updated/' setup.py | ||
rm setup.py.bak | ||
@touch $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a change that was required for the sdist work you were doing, and should not be needed at the moment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. This is only required if you try to build anki as sdist instead of bdist_wheel. But having this allow me to use sdist
too and cargo already requires this make rule to update its version. So it is just something you have to do anyway (for cargo.toml).
70e7d81
to
28bb567
Compare
34837ec
to
18f4a4d
Compare
# Conflicts: # .github/workflows/checks.yml
18f4a4d
to
58ba764
Compare
Thanks Evandro! I'd prefer to point people to the support site - I wonder if pypi will accept that. |
I tried uploading it to pypi using the change you did on the commit ee71e5d and pypi rejected the upload/wheel:
Using This problem happens because of the |
Thanks for looking into it. Would you mind trying this branch and see if it fixes it for you when no @ is included? If it solves the problem, I can send through a PR. https://github.com/ankitects/maturin/tree/optional_email After checking it out, you should be able to run 'cargo install --path .' to install the binary to ~/.cargo/bin, and you can then copy it to the pyenv\bin or scripts folder |
It worked: https://pypi.org/project/ankirspy2/ I opened a pull request: PyO3/maturin#290 |
Password is set up, so this should be good to go when 2.1.24 is released. Thanks for your work on this Evandro! |
Importing the anki2 Python package (https://pypi.org/project/anki2/) does not work for me. After
I guess maybe it would work with if Anki were instead released in https://pypi.org/project/anki/? |
That module was not supposed to work because I had to rename If I decided to make my |
Oh, OK. Will @dae 's upload once he does a next release overwrite the If so, might be better to remove the |
I just deleted the But you do not have to wait for his upload, you can install them right now, These are the same Python wheels which will be uploaded when the first release of anki is launched. Just download the right of according to your OS. https://github.com/ankitects/anki/actions/runs/82453775 If these wheels are not working for you right now, then they will not work when anki is finally released to |
I intend to use the wheels from a Bazel workspace via https://github.com/bazelbuild/rules_python, and I don't know how to make it consume wheels the rules install themselves from a |
I've tagged 2.1.24 in preparation for a release, and the wheels appear to have built correctly. Two things I noticed:
|
Accordingly to the
The
I could open a pull request adding this restriction. @dae, can you delete the versions You can delete it by accessing the management page:
I just installed anki from
|
Unfortunately this doesn't seem to yet work for my setup (which is relatively unusual - http://bazel.io plus Python rules):
Looks like for some reason the Bazel Python rules are looking inside (in case I'm doing something wrong: my But other than that: |
You could open an issue asking them to not assume that the directory inside the wheel has the same name as the wheel file, as the file can be renamed as we are doing. |
Hi guys,
|
Thanks!
I am working on a pull request to do this. |
I just finished the implementation with the pull requests:
Beyond these problems, we also do not have enough space to cache the things and speed up the build process, as the limit is 5GB (#528 - Create actions for Windows and Mac OS) and a single build with Python 3.7/Rust uses about 3.5GB and we cannot use the same cache for Python 3.7 and 3.8. Then, if we also cached Python 3.8, it would take about 7G, making the cache fail most times. |
.25 is now on PyPI, including Python 3.8 wheels. Thanks for all your work on this Evandro, I'm sure a lot of people will find them useful. |
Runs only on tagged releases of anki:
Requires a GitHub Actions Secret to be set with the name
TWINE_PASSWORD
where the contents are a pypi token, i.e.,TWINE_PASSWORD: pypi-12k3j12lj3hj1kj2bç31...
. Notice the token contents have to start withpypi-
, e.g.,pypi-12k3j12lj3hj1kj2bç31...
.As there are 3 different projects:
The token
TWINE_PASSWORD
will have to have access to all repositories on the account. An alternative to this would be to duplicate the code 3 times, each one of them, uploading one repository at a time with a differentTWINE_PASSWORD
token. On this case, 3 pypi tokens would have to be created, one for each repository.TWINE_PASSWORD_AQT
TWINE_PASSWORD_ANKI
TWINE_PASSWORD_ANKIRSPY
These are the testing package/repositories I created on PyPi to test if this is working. I will delete them after this is merged:
ping @agentydragon