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

Clean up for PyPI Upload #187

Merged
merged 12 commits into from
May 9, 2020
Merged

Clean up for PyPI Upload #187

merged 12 commits into from
May 9, 2020

Conversation

AdamGleave
Copy link
Member

@AdamGleave AdamGleave commented May 8, 2020

  • Add info to setup.py
  • Remove stray src/__init__.py file (FYI @shwang this was why pytype was breaking, oops)
  • Update README.md, especially code contribution guidelines.
  • Add PyPI badge to README.md; this doesn't work yet, but will once I upload it to PyPI and I'd rather not trash the commit history with two PRs for this.

I've done an upload to test PyPI and it looks OK, so probably checking the README.md makes sense is most important part.

Closes #120

@codecov
Copy link

codecov bot commented May 9, 2020

Codecov Report

Merging #187 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #187   +/-   ##
=======================================
  Coverage   88.38%   88.38%           
=======================================
  Files          71       71           
  Lines        4871     4871           
=======================================
  Hits         4305     4305           
  Misses        566      566           
Impacted Files Coverage Δ
src/imitation/scripts/parallel.py 94.11% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0173423...3ba5cff. Read the comment docs.

@AdamGleave AdamGleave requested a review from shwang May 9, 2020 01:06
@AdamGleave AdamGleave requested a review from qxcv May 9, 2020 01:12
@qxcv
Copy link
Member

qxcv commented May 9, 2020

The substantive changes look good to me. However, when trying to install, I ran into the following issues:

  • Currently requires Python >=3.7. Is this actually necessary? It's not a huge deal, but it would be nice to have something that works with the default Python shipped in Ubuntu 18.04 (at least for the next 6-12 months, anyway).
  • Also requires Python <=3.7: pip (shipped with Conda + Python 3.8) can't find Ray 0.7.4 for some reason: ERROR: Could not find a version that satisfies the requirement ray[debug]==0.7.4 (from imitation==0.1a0) (from versions: 0.8.4, 0.8.5). Pretty sure this is because 0.7.4 was released in September, and there were presumably no Python 3.8 wheels back then. Could fix by upgrading Ray, or just by asking them to upload more wheels for their old releases 😛
  • When using Python 3.7.7 in a fresh Conda environment, everything installs (via pip), but with the following warning: ERROR: gym 0.17.2 has requirement cloudpickle<1.4.0,>=1.2.0, but you'll have cloudpickle 1.4.1 which is incompatible.. I can't see any package that actually requires cloudpickle>1.4.0, so this is probably just a case of pip sucking at dependency resolution. Neverthless, it might be an idea to put cloudpickle<1.4.0 in the install_requires for this package until OpenAI updates Gym? (OTOH maybe there's some way to make pip do the right thing by moving Gym either before or after all the other dependencies? Not really sure because pip's install order has always been black magic to me.)

@qxcv
Copy link
Member

qxcv commented May 9, 2020

On install order:

As of v6.1.0, pip installs dependencies before their dependents, i.e. in “topological order.” This is the only commitment pip currently makes related to order. While it may be coincidentally true that pip will install things in the order of the install arguments or in the order of the items in a requirements file, this is not a promise.

…so there probably aren't any reliable escape hatches to make pip do the right thing.

@AdamGleave
Copy link
Member Author

Thanks for the review @qxcv.

  • Currently requires Python >=3.7. Is this actually necessary? It's not a huge deal, but it would be nice to have something that works with the default Python shipped in Ubuntu 18.04 (at least for the next 6-12 months, anyway).

We're using dataclasses which were only introduced in Python 3.7, sadly.

  • Also requires Python <=3.7: pip (shipped with Conda + Python 3.8) can't find Ray 0.7.4 for some reason: ERROR: Could not find a version that satisfies the requirement ray[debug]==0.7.4 (from imitation==0.1a0) (from versions: 0.8.4, 0.8.5). Pretty sure this is because 0.7.4 was released in September, and there were presumably no Python 3.8 wheels back then. Could fix by upgrading Ray, or just by asking them to upload more wheels for their old releases stuck_out_tongue

Good catch, this is annoying. @shwang can you remember why we chose 0.7.4 -- do more recent versions not work? I'm also inclined to make this an optional dependency -- as far as I can see this is only used in scripts/parallel.py, which many potential consumers may not need it.

  • When using Python 3.7.7 in a fresh Conda environment, everything installs (via pip), but with the following warning: ERROR: gym 0.17.2 has requirement cloudpickle<1.4.0,>=1.2.0, but you'll have cloudpickle 1.4.1 which is incompatible.. I can't see any package that actually requires cloudpickle>1.4.0, so this is probably just a case of pip sucking at dependency resolution. Neverthless, it might be an idea to put cloudpickle<1.4.0 in the install_requires for this package until OpenAI updates Gym? (OTOH maybe there's some way to make pip do the right thing by moving Gym either before or after all the other dependencies? Not really sure because pip's install order has always been black magic to me.)

Are we sure gym has a good reason for this? The PR that introduced this range is https://github.com/openai/gym/pull/1836/files back in March and 1.4.0 was only released 12 days ago. I'm inclined to ignore it unless we see breakage -- cloudpickle doesn't have a changelog but if following semantic versioning this shouldn't have breaking changes.

@AdamGleave
Copy link
Member Author

Ray 0.7.5 was released Sep 24 and our Ray commit a4d42f8 was on Sep 19th, so I think 0.7.4 is just the last tested-working version, rather than us having a particular reason to pin to an older version.

I just tried it with the latest version and tests/test_scripts.py still passes. Certainly possible there's a gremlin we'll run into, but most failure modes I can think of for Ray would manifest immediately. Given this I've updated setup.py to permit any of the 0.8.x series.

I think TensorFlow also doesn't have 3.8 wheels for the version range we want, though. I imagine they'll add that next bugfix release for 1.15.x though, and hopefully we will transition to PyTorch with Stable Baselines eventually.

@qxcv
Copy link
Member

qxcv commented May 9, 2020

I think TensorFlow also doesn't have 3.8 wheels for the version range we want, though. I imagine they'll add that next bugfix release for 1.15.x though, and hopefully we will transition to PyTorch with Stable Baselines eventually.

Good catch on TF, but this issue suggests they won't be releasing Python 3.8 wheels for TF 1.15.X:

tensorflow/tensorflow#37461

Guess this package is Python 3.7-only until we switch to PyTorch 🤷‍♂️

@AdamGleave
Copy link
Member Author

Good catch on TF, but this issue suggests they won't be releasing Python 3.8 wheels for TF 1.15.X:

tensorflow/tensorflow#37461

Guess this package is Python 3.7-only until we switch to PyTorch

Ah that's a shame :( Porting to PyTorch shouldn't be that hard although I'm not sure when/if I'll have the bandwidth.

@AdamGleave AdamGleave merged commit cf51186 into master May 9, 2020
@AdamGleave AdamGleave deleted the prepare-for-pypi branch May 9, 2020 19:43
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.

Upload to PyPI?
2 participants