rlworkgroup / akro

Spaces types for reinforcement learning
MIT License
11 stars 4 forks source link

Automatically retrieve package version from tag #23

Closed ryanjulian closed 5 years ago

ryanjulian commented 5 years ago

During deployment, we'd like to automatically set the package version to the tag name from GitHub. Here we check the TRAVIS_TAG environment variable in setup.py, and use whatever string is there if it exists. If there is no tag, setup.py falls back to a DEFAULT_VERSION string, which should be updated each release.

There are a few fancy packages for doing this automatically (e.g. versioneer and pbr), but using pbr requires rewriting our setup files, and versioneer forces you to commit autogenerated code to the repo.

This setup is dead simple, unlikely to fail, and easy to understand.

codecov[bot] commented 5 years ago

Codecov Report

Merging #23 into master will decrease coverage by 0.57%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
- Coverage   69.35%   68.78%   -0.58%     
==========================================
  Files          17       18       +1     
  Lines         359      362       +3     
  Branches       60       60              
==========================================
  Hits          249      249              
- Misses        102      105       +3     
  Partials        8        8
Impacted Files Coverage Δ
src/akro/__version__.py 0% <0%> (ø)

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 0d30014...848c506. Read the comment docs.

ryanjulian commented 5 years ago

FYI tested this on rlworkgroup/viskit and it's working