-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Increment miner version * Add package build tool * Add how to publish package document
- Loading branch information
1 parent
9183e54
commit b082a3f
Showing
3 changed files
with
58 additions
and
1 deletion.
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,35 @@ | ||
# Build and Publish package to PyPI repository | ||
|
||
## Build | ||
|
||
Run build script in this repository. | ||
If you encounted `already exists` errors, You have to remove `build` and `dist` directories before building. | ||
|
||
```sh | ||
bash tools/build_package.sh | ||
``` | ||
|
||
## Publish | ||
|
||
After build package, publish to PyPI repository. | ||
You should publish to Test PyPI repository first. | ||
|
||
### Test | ||
|
||
Upload to test repository. | ||
|
||
```sh | ||
twine upload --repository-url https://test.pypi.org/legacy/ dist/* | ||
``` | ||
|
||
Then check to be able to install. | ||
|
||
```sh | ||
pip install --upgrade --index-url https://test.pypi.org/simple/ scopt | ||
``` | ||
|
||
### Production | ||
|
||
```sh | ||
twine upload dist/* | ||
``` |
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 +1 @@ | ||
__version__ = '0.0.1' | ||
__version__ = '0.0.2' |
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,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
REPO_ROOT="$(cd "$(dirname "$0")/.."; pwd)" | ||
BUILD_DIR="${REPO_ROOT}/build" | ||
DIST_DIR="${REPO_ROOT}/dist" | ||
|
||
# enable recursive match by ** | ||
shopt -s globstar | ||
cd "${REPO_ROOT}" | ||
|
||
# check directories are already exist | ||
if [ -e ${BUILD_DIR} ]; then | ||
echo "Build directory already exists: ${BUILD_DIR}" | ||
exit 1 | ||
elif [ -e ${DIST_DIR} ]; then | ||
echo "Dist directory already exists: ${DIST_DIR}" | ||
exit 1 | ||
fi | ||
|
||
# build package | ||
python setup.py sdist bdist_wheel |