Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
init: | ||
cd ../.. | ||
yarn bootstrap | ||
cd - | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
pip install -e . | ||
make prepare-jupyter | ||
|
||
prepare-jupyter: | ||
jupyter nbextension install --sys-prefix --symlink --overwrite --py pydeck | ||
jupyter nbextension enable --sys-prefix --py pydeck | ||
jupyter labextension install @jupyter-widgets/jupyterlab-manager | ||
cd ../../modules/jupyter-widget/ | ||
jupyter labextension install . | ||
|
||
test: | ||
pytest | ||
|
||
docs: | ||
cd docs | ||
make html | ||
|
||
# e.g. `make RELEASE_TYPE=MAJOR bump-version | ||
bump-version: | ||
python bump_version.py $RELEASE_TYPE | ||
export $PYDECK_VERSION=$@ | ||
|
||
publish-conda: | ||
echo "NOTE pydeck does not yet publish to conda-forge. Awaiting #4202." | ||
|
||
publish-pypi: | ||
rm -rf ./dist/* | ||
pip install . | ||
python setup.py sdist bdist_wheel | ||
pip install twine | ||
python -m twine upload dist/* | ||
|
||
# e.g. `make RELEASE_TYPE=MAJOR bump-and-publish | ||
bump-and-publish: | ||
make bump-version $RELEASE_TYPE | read $pydeck_version | ||
git commit -am "Release version $pydeck_version" | ||
make test | ||
make publish-conda | ||
make publish-pypi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import argparse | ||
import sys | ||
|
||
import semver | ||
import jinja2 | ||
|
||
from pydeck._version import __version__ | ||
|
||
RELEASE_TYPES = ["MAJOR", "MINOR", "PATCH", "BETA", "ALPHA", "RC"] | ||
|
||
|
||
def bump(release_type): | ||
version_info = semver.parse_version_info(__version__) | ||
if release_type == "MAJOR": | ||
return version_info.bump_major() | ||
elif release_type == "MINOR": | ||
return version_info.bump_minor() | ||
elif release_type == "PATCH": | ||
return version_info.bump_patch() | ||
elif release_type == "ALPHA": | ||
return version_info.bump_prerelease(token="a") | ||
elif release_type == "BETA": | ||
return version_info.bump_prerelease(token="b") | ||
elif release_type == "RC": | ||
return version_info.bump_prerelease(token="rc") | ||
else: | ||
raise Exception( | ||
"Release type must be one of the following:", ", ".join(RELEASE_TYPES) | ||
) | ||
|
||
|
||
def rewrite_version_file(semver): | ||
with open("pydeck/_version.py", "w+") as f: | ||
t = jinja2.Template("__version__ = '{{semver_str}}'") | ||
contents = t.render(semver_str=str(semver)) | ||
f.write(contents) | ||
|
||
|
||
parser = argparse.ArgumentParser( | ||
description="Bump semver for pydeck. Modifies pydeck/_version.py directly." | ||
) | ||
parser.add_argument( | ||
"release_type", action="store", choices=RELEASE_TYPES, help="Release type to bump" | ||
) | ||
|
||
if __name__ == "__main__": | ||
args = parser.parse_args() | ||
bumped_version = bump(args.release_type) | ||
msg = "Raising pydeck {} to {} | Proceed? (Y/n) ".format( | ||
__version__, str(bumped_version) | ||
) | ||
response = input(msg) | ||
if response != "Y": | ||
sys.exit(0) | ||
rewrite_version_file(bumped_version) | ||
print(bumped_version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
#!/usr/bin/env python | ||
|
||
# Copyright (c) Uber Technologies, Inc. | ||
# Distributed under the terms of the Modified BSD License. | ||
version_info = (0, 2, 1) | ||
__version__ = '.'.join(map(str, version_info)) | ||
__version__ = '0.2.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ requests | |
sphinx | ||
recommonmark | ||
jupyterlab | ||
semver |