Unverified Commit 98663ee7 authored by Wenwei Zhang's avatar Wenwei Zhang Committed by GitHub
Browse files

Fix version bug when packaging pypi (#25)

parent 87339473
...@@ -27,7 +27,7 @@ We use the following tools for linting and formatting: ...@@ -27,7 +27,7 @@ We use the following tools for linting and formatting:
- [yapf](https://github.com/google/yapf): formatter - [yapf](https://github.com/google/yapf): formatter
- [isort](https://github.com/timothycrosley/isort): sort imports - [isort](https://github.com/timothycrosley/isort): sort imports
Style configurations of yapf and isort can be found in [.style.yapf](../.style.yapf) and [.isort.cfg](../.isort.cfg). Style configurations of yapf and isort can be found in [setup.cfg](../setup.cfg).
We use [pre-commit hook](https://pre-commit.com/) that checks and formats for `flake8`, `yapf`, `isort`, `trailing whitespaces`, We use [pre-commit hook](https://pre-commit.com/) that checks and formats for `flake8`, `yapf`, `isort`, `trailing whitespaces`,
fixes `end-of-files`, sorts `requirments.txt` automatically on every commit. fixes `end-of-files`, sorts `requirments.txt` automatically on every commit.
......
...@@ -13,7 +13,9 @@ jobs: ...@@ -13,7 +13,9 @@ jobs:
with: with:
python-version: 3.7 python-version: 3.7
- name: Build MMDet3D - name: Build MMDet3D
run: python setup.py sdist run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI - name: Publish distribution to PyPI
run: | run: |
pip install twine pip install twine
......
## Changelog ## Changelog
### v0.1.0 (9/7/2020) ### v0.5.0 (9/7/2020)
MMDetection3D is released. MMDetection3D is released.
...@@ -81,6 +81,12 @@ version_info = ({}) ...@@ -81,6 +81,12 @@ version_info = ({})
def get_version(): def get_version():
with open(version_file, 'r') as f: with open(version_file, 'r') as f:
exec(compile(f.read(), version_file, 'exec')) exec(compile(f.read(), version_file, 'exec'))
import sys
# return short version for sdist
if 'sdist' in sys.argv or 'bdist_wheel' in sys.argv:
return locals()['short_version']
else:
return locals()['__version__'] return locals()['__version__']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment