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

Automate release to PyPi using a tagged commit and a deploy hook #146

Closed
7 of 8 tasks
davelab6 opened this issue Aug 13, 2013 · 25 comments
Closed
7 of 8 tasks

Automate release to PyPi using a tagged commit and a deploy hook #146

davelab6 opened this issue Aug 13, 2013 · 25 comments

Comments

@davelab6
Copy link
Contributor

davelab6 commented Aug 13, 2013

  • As part of the build process, create packages for downstream users, and
  • deploy them to gh-pages the Github Release page

Packages:

Updated 2016-10-12: Striking out many formats which now seem irrelevant, given we now only have hard dependencies on python packages. Thus:

@felipesanches
Copy link
Collaborator

Let's plan to start doing it for every milestone starting with milestone 0.2.0 ?

@felipesanches
Copy link
Collaborator

Any idea if there are ways to automate this? Ideally this should not be manual work. It should be the task of an automated release script. I guess. (I would hope :-D)

@davelab6
Copy link
Contributor Author

I updated the main text, striking out many formats which now seem irrelevant, given we now only have hard dependencies on python packages. Thus I think all we should do here is follow https://docs.travis-ci.com/user/deployment/pypi/ build pypi packages for tagged commits

@felipesanches
Copy link
Collaborator

great! :-)

@davelab6 davelab6 changed the title Create packages for GNU+Linux distros Create PyPi packages for tagged commits Oct 13, 2016
@davelab6 davelab6 changed the title Create PyPi packages for tagged commits Release 0.2.0 on PyPi using a tagged commit and hooks/automation Nov 21, 2016
@felipesanches
Copy link
Collaborator

Ok. I'm going to do this. At a first glance, I see (here: https://pypi.python.org/pypi/fontbakery/0.0.13) that the fontbakery "package index owners" are hash3g and davelab6. I guess it means only these users can trigger a deploy with their username/password credentials.

I think I'll have to be added as a package owner. Can you add me, @davelab6 ?

@felipesanches
Copy link
Collaborator

felipesanches commented May 22, 2017

Also, I noticed that the author field on setup.py is a bit too generic "Font Bakery Authors". I'd like to have my name (as well as yours and Vitaly) in there. There's an interesting discussion about multiple authors in the author field here: http://bugs.python.org/issue6992

A good point is that the author_email field should ideally point to a project mailing-list to make it easier for the community to collaborate (avoiding user emails to a single developer). Would it be too annoying to have googlefonts-discuss@googlegroups.com listed in there or would you rather keep your personal email address in the PyPI author_email field, @davelab6 ?

@davelab6
Copy link
Contributor Author

Can you add me, @davelab6 ?

Yes - what is your username?

@felipesanches
Copy link
Collaborator

fsanches

@davelab6
Copy link
Contributor Author

davelab6 commented May 22, 2017 via email

@davelab6
Copy link
Contributor Author

the author field on setup.py is a bit too generic "Font Bakery Authors". I'd like to have my name (as well as yours and Vitaly) in there

The generic name is used to prevent the complications mentioned in the thread :) If you want to spend time dealing with those, that's fine, but I don't care to :)

I think it would only be annoying to have googlefonts-discuss@googlegroups.com listed in there if it got a lot of email; I doubt that's the case, so go ahead.

felipesanches added a commit to felipesanches/fontbakery that referenced this issue May 23, 2017
@felipesanches
Copy link
Collaborator

I also doubt that fontbakery would get a large amount of email from users. So we'll stick to using the googlefonts-discuss mailing list for this v0.2.0 release. If we start getting annoyed by this, it may justify setting up a project mailing list in the future (again, I doubt it will produce any significant amount of messages).

@felipesanches
Copy link
Collaborator

We're almost there!

I was able to automate the build and pypi upload on travis, but I'm having serious trouble to get a successful auth:

HTTPError: 401 Client Error: You must be identified to edit package information for url: https://pypi.python.org/pypi

https://travis-ci.org/googlefonts/fontbakery/builds/235070739

@felipesanches
Copy link
Collaborator

Both here (https://docs.travis-ci.com/user/encryption-keys/) and here (pypa/twine#233 (comment)) I got hints that I should escape special characteres on the pypi login password when encrypting it to store in the .travis.yaml file.

I tried that, but it still fails.

@felipesanches
Copy link
Collaborator

Also, a previous issue that I debugged earlier was that the build/upload jobs was not even triggering because of the safelisting we already had on our Travis rules:

https://docs.travis-ci.com/user/customizing-the-build#Safelisting-or-blocklisting-branches

After adding a white-list regex for version tags, I got it at least to run the build. But now I have to figure out what's still wrong on the authentication side of things...

@felipesanches
Copy link
Collaborator

I tried adding a "server" key with value "https://upload.pypi.org/legacy/" but that also fails, but differently:

Uploading distributions to https://upload.pypi.org/legacy/
Uploading fontbakery-0.2.0.tar.gz
HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/

@davelab6
Copy link
Contributor Author

davelab6 commented May 23, 2017 via email

@felipesanches
Copy link
Collaborator

Maybe Luciano Ramalho (@ramgarlic)...

@felipesanches
Copy link
Collaborator

I've just released fontbakery 0.2.0 on pypi by running locally:

python setup.py register -r pypi

https://pypi.python.org/pypi/fontbakery/0.2.0

@felipesanches
Copy link
Collaborator

I'll get back to this issue on the next release to make it work automatically on a Travis deploy hook.

I've seen a website stating that "The first upload of your package has to be done manually." (https://web.archive.org/web/20170523183448/https://openedx.atlassian.net/wiki/display/OpenOPS/Publishing+a+Package+to+PyPI+using+Travis)
I'm not sure that statement is accurate, but if that's the case, we'll figure out when we apply the v0.3.0 tag :-)

@felipesanches felipesanches changed the title Release 0.2.0 on PyPi using a tagged commit and hooks/automation Release 0.3.0 on PyPi using a tagged commit and hooks/automation May 23, 2017
@felipesanches felipesanches modified the milestones: 0.3.0 Collection Dashboard Web UI, 0.2.0 Binary Checks Are Reliable May 23, 2017
@felipesanches felipesanches changed the title Release 0.3.0 on PyPi using a tagged commit and hooks/automation Automate release to PyPi using a tagged commit and a deploy hook May 23, 2017
@davelab6
Copy link
Contributor Author

davelab6 commented May 24, 2017 via email

@felipesanches
Copy link
Collaborator

felipesanches commented Jul 4, 2017

I tried uploading a new release (Fontbakery v0.2.1 today in order to address issues related to #1406 (comment))

This command did not work today because the legacy pypi API was just deprecated (exactly today, July 3rd, what a coincidence!). So I ended up uploading the new release using twine this way:

python setup.py bdist_wheel
twine upload dist/*

https://pypi.python.org/pypi/fontbakery/0.2.1

@davelab6
Copy link
Contributor Author

@felipesanches is that enough automation for the 0.3.0 release?

@felipesanches
Copy link
Collaborator

That's good enough for now, yes. But keep the issue open, please.

@davelab6
Copy link
Contributor Author

I guess for now you could add info about how to make a release to README?

felipesanches added a commit that referenced this issue Aug 8, 2017
In preparation for the 0.3.0 release.
(issue #146)
@felipesanches
Copy link
Collaborator

Release guidelines and instructions have just been added to the README :-)

felipesanches added a commit to felipesanches/fontbakery that referenced this issue Oct 6, 2017
We never really got that to work properly.
(issue fonttools#146)
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

3 participants