Skip to content

Conversation

@Kami
Copy link
Contributor

@Kami Kami commented Dec 14, 2018

This pull request adds support for running various lint checks and pack tests under Python 3.6 (in addition to Python 2.7).

In addition to new Python 3 checks, I also added new "compile" check for Python 2.7 and Python 3.6 job which verifies Python syntax in pack files is valid.

A couple of things to keep in mind:

  1. For the time being, we will run those checks on all the packs, but won't consider Python 3.x check and test failures as fatal (aka failing the build).
    This will allow us to identify "problematic" packs. The goal is to add new python_version attribute to pack.yaml file and utilize that attribute in CI to determine if pack supports Python 3. For packs which claim support for Python 3, build will fail if Python 3 checks fail, and for ones which don't, it wont (will open a PR for that in StackStorm/st2 shortly).
  2. Needed to make small change to script in st2sdk because CI scripts use StackStorm from git checkout and all the shebangs in scripts in the repo explicitly default to python2.7 binary.

TODO

  • Publish new version of st2sdk to PyPi
  • Fix CI in st2sdk
  • Update all packs to use this new Circle CI config

@Kami Kami requested a review from LindsayHill December 14, 2018 10:23
@Kami
Copy link
Contributor Author

Kami commented Dec 14, 2018

Here is an example build output:

  1. Python 2.7 - https://circleci.com/gh/StackStorm-Exchange/stackstorm-csv/47
  2. Python 3.6 - https://circleci.com/gh/StackStorm-Exchange/stackstorm-csv/46 - here the test steps fails due to non-Python 3 compatible syntax in one of the Python modules, but we don't mark step as failed, because this would mark build as failed and that's not desired right now.

Sadly Circle CI doesn't have "allow failure" option similar to Travis, so we need to utilize "|| exit 0" workaround which is not ideal.

@LindsayHill
Copy link
Contributor

I'm generally happy with the approach. I like the idea of running Py3 checks, but not failing on them. Not at this stage, anyway. Just means we'll have to go and manually eyeball it to check Py3 status.

Will leave it until next year before it becomes a breaking change

@Kami
Copy link
Contributor Author

Kami commented Jan 8, 2019

I will go ahead, merge this and add new CircleCI config to all the pack repos.

Once this PR is finished and merged (StackStorm/st2#4474) I will open a new PR which fails Python 3 build for packs which declare support for Python 3.

@Kami Kami changed the title [WIP] Add support for Python 3.x checks to pack Circle CI config Add support for Python 3.x checks to pack Circle CI config Jan 8, 2019
@Kami Kami merged commit cc690ba into master Jan 8, 2019
@Kami Kami deleted the python3_pack_ci branch January 8, 2019 10:07
@Kami
Copy link
Contributor Author

Kami commented Jan 8, 2019

It's on - https://circleci.com/gh/StackStorm-Exchange.

I'm working on finishing and merging StackStorm/st2#4474. Once that's done, I will go ahead and update pack metadata for all the Exchange packs and CI as mentioned above.

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.

3 participants