Commit Graph

5 Commits

Author SHA1 Message Date
Matthew Treinish f17f8f073e Add python 3.8 support and deprecate python 3.5 (#3268)
* Add python 3.8 support and deprecate python 3.5

This commit adds support for running terra under python 3.8. It does
this by adding the trove classifiers to the package metadata and adding
a test job for python 3.8 (only travis for now this can be expanded in
the future when azure pipelines adds it to their image). At the same
time this commit starts the deprecation window for python 3.5. Python
3.5 goes end of life by upstream python in Sept. 2020. We should give
our users running with python 3.5 (which is about 10% of our users based
on pypi data) fair notice that when upstream python stops supporting it
we do as well.

* Fix lint

* Add back empty cache detection

As part of the refactors the empty stestr timing cache removal code was
removed from the travis config, but the cache wasn't removed. Adding the
python 3.8 job causes a failure because travis has no cached timing data
but still creates the empty directory which triggers
mtreinish/stestr#266. This adds back the empty cache removal to
workaround it so we can use the timing data for scheduling in future
runs.

* Add azure-pipelines python 3.8 jobs too

* Fix python 3.8 dictionary keys changed error

Starting in python 3.8 a new RuntimeError is raised, RuntimeError:
dictionary keys changed during iteration. This is caused by modifying an
iterator while looping over it. We were doing that in the
optimize_swap_before_measure pass. This commit fixes this by wrapping
the iterator in list() to make a copy of it for looping. This way we
don't modify the contents of what we're iterating over in the pass.

* Revert "Add azure-pipelines python 3.8 jobs too"

The missing matplotlib wheels are blockers for windows and osx
environment. Since we do not have the necessary dependencies installed
in those ci envs to compile matplotlib from source. We'll rely on just
travis for 3.8 testing until the matplotlib 3.2.0 release is pushed so
we don't have to compile it.

This reverts commit 40157621b1.

* Add skip for failing matplotlib test

The image comparison tests which are quite flaky are failing with
matplotlib compiled on 3.8. Looking at the image output from these
failures are very subtle (looks like resolution differences) again
questioning the value of these tests. This commit just skips the test
that is failing here to unblock the PR.

* Add azure 3.8 test jobs

* Pin to pre-release mpl for python 3.8

* Add spawn guard for python3.8 osx in examples

When running examples with execute, transpile, or any other calls using
parallel_map() the new default for spawn instead of fork requires that
scripts have a __name__ == "__main__" check in them to function
properly. If not calls to parallel_map fail errors around the
bootstrapping phase. To avoid this in the ci jobs this commit adds the
necessary checks to the example scripts we run in ci as part of
test_examples.

* Remove cryptography pin from constraints file

We pinned the cryptography package version back during the cryptography
2.6 release which broke our ci. It was a temporary step to avoid a
packaging issue in CI that was blocking development. However, when the
issue was resolved we never circled back to fix the issue. Now trying to
enable python 3.8 support to terra cryptography >=2.8 is needed for
python 3.8 on windows (to get a precompiled binary). This commit removes
the unecessary pin to unblock windows 3.8 ci.

* Bump cibuildwheel version to build 3.8 wheels

cibuildwheel 1.0.0 was released in early November [1] and added support
for building python 3.8 wheels. This commit bumps the cibuildwheel
version we use in the wheel build jobs at release time to also build 3.8
wheels for upload to pypi.

* Add skip and release note about macos py38 issues

This commit adds a skip for the failing python 3.8 test on osx and
windows so that we don't block everything over a small issue in the
tests. It also add a release note documenting the limitation with python
3.8 on macos with regardess to parallel_map/multiprocessing. Since this
limitation is new for this release (being the first release with python
3.8 support) we should document it as a known issue in the release
notes, especially since it likely won't be resolved until a python 3.8.1
release.

* Revert "Add spawn guard for python3.8 osx in examples"

While we can fix the tests to work on osx python3.8 by adjusting the
example scripts to only call functions using parallel_map from inside a
block run via if __name__ == '__main__': this unecessarily changes the
scripts for the quirks of a single environment. This commit reverts the
example scripts back to their original form and instead just skips the
unittest that executes them on python 3.8 macOS. We already have
documented this limitation in the release notes. When/if we have an
alternative solution for how we launch additional processes in python
3.8 on macOS that does not require this workaround we can look at
removing the skip.

This reverts commit 76ae197631.

* Apply suggestions from code review

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>
2019-12-10 22:43:58 +02:00
Matthew Treinish 37036f494d Rewrite dag drawer to not use nxpd (#3280)
* Rewrite dag drawer to not use nxpd

The nxpd library is quite stale and hasn't seen an update in 3 years.
The most recent release of networkx 2.4 is incompatible with nxpd now
because nxpd was using deprecated (and now removed) api calls from
networkx. Additionally, the functionality provided by nxpd already
exists in networkx so there is no reason to rely on an additional
library outside of networkx and pydot. This commit updates the dag
drawer to no longer use nxpd and uses networkx's drawing features
instead.

* Cap networkx for python 3.5

In the networkx release notes for 2.4 [1] it states clearly that the 2.4
release is the last release with python 3.5 support. Since the release
timeline is not fixed and we may end up support python 3.5 in terra
longer than networkx this adds a capped version of networkx on 2.4 for
python 3.5.

[1] https://networkx.github.io/documentation/stable/release/release_2.4.html

* Adjust python 3.5 cap

Since networkx 2.4 is seemingly relying on the guaranteed insertion
ordering for dicts introduced in 3.6 for how we're using topological
sort this adjusts the cap previously introduced to be <2.4 instead of
<=2.4. This should avoid the failures related to this on python 3.5 and
networx 2.4.

* Avoid duplicate requirements with cap
2019-11-09 04:49:46 +00:00
Matthew Treinish 38b03f4d1a Pin networkx in constraints (#3276)
With the recent release of networkx 2.4 several deprecated APIs were
removed. This broke the visualization dependency nxpd. A fix is in
progress [1] to address this. But in the meantime to get tests working
again we need to make sure we do not install networkx 2.4 for testing.
This commit does this by pinning the version we use in our testing in
the constraints file to 2.3. This will unblock our development while we
wait for a new nxpd release.

[1] https://github.com/chebee7i/nxpd/pull/15
2019-10-17 10:16:20 -04:00
Diego M. Rodríguez 7f01b8bae8 Update pylint to 2.3 (#2522)
* Bump pylint version to 2.3.x

* Upda constraints.txt

* Reintroduce constraints.txt
2019-05-28 16:46:54 -04:00
Matthew Treinish 5285d1a537 Add constraints to pin pylint to known working version (#1868)
* Add constraints to pin pylint to known working version

This commit adds a constraints file so we're always running pylint and
astroid at known working version. The 2 are requirements are very coupled
and small changes in one often requires an update in the other.
Unfortunately new versions of pylint often change or add rules which
makes running it unpinned not a good decision. To ensure a consistent
environment for running pylint this commit leverages pip constraints to
make sure we always install the same version of astroid and pylint.

* Pin for broken cryptography release today too
2019-02-27 14:35:01 -05:00