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

[WIP] Setuptools packaging improvements - make each st2 component packagable and installable via package #1677

Closed
wants to merge 58 commits into from

Conversation

Kami
Copy link
Member

@Kami Kami commented Jul 1, 2015

This pull requests builds on top of of #1647 and #1668.

I spent a lot of time finishing, polishing and testing all the changes from #1668 locally. Everything worked and looked fine so I decided to merge it into master. Sadly this turned out to be a mistake - there were many, many issues with packaging and other workflows used by our CI.

After 3-4 hours of digging in and fixing issues, I still haven't managed to fix all of them so I decided to revert changes in the master and unbreak it. I believe that's better than trying to rush to whole thing. Next step will be to address all the issues and run all the packaging and related workflows on this branch and only merge it into master when everything passes.

I will work with / ask @DoriftoShoes for help with running everything on a particular branch (not sure if we are there yet, might require some changes).

The biggest offenders currently are:

  • Making sure we use pip >= 6.0.0 everywhere. I believe I managed to fix this by using virtualenv everywhere, but there might still be issues somewhere.
  • Getting rid of the "recursive-include" abuse in the MANIFEST.in and replacing it with collecting all the code packages inside the setup.pyfiles.

This branch includes the following changes and improvements:

  1. Add new dist_utils.py module which is copied over to each component during build step and used inside setup.py instead of copy and pasting code over in setup.py.
  2. Update all the setup.py files to include license and url attribute.
  3. Add long_description attribute to each setup.py file. This attribute is generated by combining together README.rest and CHANGELOG.rst file.
  4. Port README from Markdown to rst (needed because of 3).
  5. Add new sdist Makefilet target which generates .tar.gz and wheel archive for each component.
  6. Update setup.py files to use __version attribute from each package init.py file. For now we simply copy over init.py from st2common. This way we don't break out existing release / build workflow, but eventually we should move to per-package version.
  7. Removed unused dependencies: flask, flask_json. This was actually done by @dennybaa, but I verified the changes and I'm pointing it out there to make it easier to track.
  8. Sort the requirements before writing them in the requirements.txt file. This way we make sure generated requirements files are always sorted the same.

TO FIX:

  • mistral_itests workflow fails (times out) on CI. I dug into it, but I couldn't reproduce the problem. It works fine locally and it also works fine if I manually run commands on the CI server.
  • st2_deploy_tests workflow fails on CI. I believe I've fixed the RHEL issue, but I don't know what's wrong with the Ubuntu one.

dennybaa and others added 30 commits June 17, 2015 21:36
…e common

code to "dist_utils.py" module and copy this module over to each component
package directory during build step.

Update affected code.
st2_version file.

Note: For now we just copy over global __init__.py from st2common during build
preparation step.
Kami added 19 commits June 30, 2015 15:57
Setuptools packaging improvements - make each st2 component packagable and installable via  package
…ways use

correct and latest version of pip.

Also update virtualenv target to install latest version of pip instead of doing
it in the requirements target.
…y so it

doesn't include changelog in the package description.
# Make sure we use latest version of pip
$(VIRTUALENV_DIR)/bin/pip install --upgrade pip

# Install stdeb st2client build dependency
Copy link
Contributor

Choose a reason for hiding this comment

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

@Kami what's stdeb?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a Python package we use in combination with setup.py to build a Debian package for st2client.

I wasn't aware of it before yesterday either. I added it here to make "make deb" self sustaining and now it also works in a local environment. Previously, this package would only magically get installed inside one of our CI workflows...

@Kami Kami force-pushed the setuptools_packaging_improvements branch from a39a38a to 210fa98 Compare July 1, 2015 14:09
@Kami Kami mentioned this pull request Jul 21, 2015
Kami added a commit that referenced this pull request Sep 2, 2015
duplicating the code across setup.py files.

Note: This file is copied over from the common location to each component
directory during the build step.
dennybaa pushed a commit to dennybaa/st2 that referenced this pull request Sep 2, 2015
…py instead of

duplicating the code across setup.py files.

Note: This file is copied over from the common location to each component
directory during the build step.
@Kami
Copy link
Member Author

Kami commented Oct 11, 2015

This is not relevant anymore since #1917 was merged.

@Kami Kami closed this Oct 11, 2015
@dzimine dzimine deleted the setuptools_packaging_improvements branch February 4, 2016 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants