Clone repository:
git clone https://github.com/OctaveLauby/olutils.git
cd olutils
One can make an editable code installation:
pip install -e .
Classic testing
python -m pytest tests -vv
python -m pylint olutils
Testing with coverage
coverage run -m pytest tests; coverage report
Or, if one has pytest-cov installed:
python -m pytest tests --cov
python -m venv venv
source venv/Scripts/activate
python -m pip install -r requirements.txt
...
deactivate
matplotlib does not have to be imported: plotting submodule is not loaded in that case
-
Check current version to know what is the next version
git tag
-
Create release branch from branch-to-release (usually dev)
git checkout -b release/x.x.x
-
Add related section in release notes, commit and push (even if not completed yet)
git commit -m "Adding release note related to current release" git push --set-upstream origin release/x.x.x
-
Create 2 pull requests on github:
- on from {release_branch} to {dev} (name="Release/x.x.x Dev)
- on from {release_branch} to {master} (name="Release/x.x.x)
-
Fill up the release note + commit and push
- Read commits descriptions
- Go through all the Files Changes
Fill free to complete missing documentations and add comments in code
-
Update setup
- Update version
- Ensure install_requires have all requirements
-
Run tests on clean venv
rm -r venv python -m venv venv source venv/Scripts/activate python m pytest -vv
If any error, fix issues + commit and push
-
Merge dev pull request on github
- Check the File Changes (one should see the new release note and the possible fixes he made)
- Merge pull request
One can redo tests locally just to be sure
-
Merge master pull request on github + Delete branch
-
Add tag and Push
- Tag master
git checkout master git pull git tag -a vx.x.x -m "Version x.x.x"
- Tag dev
git checkout dev git pull git tag -a vx.x.x-dev -m "Version x.x.x (dev)"
- Push
git push origin --tags
-
Update local repo:
- Remove release branch:
git branch -d release/x.x.x
- Remove release branch:
First make sure to be on master branch with latest release.
-
Install distribution libraries
pip install check-manifest pip install twine pip install wheel
-
Building manifest file:
check-manifest --create
-
Building the wheel:
python setup.py bdist_wheel
-
Building the source distribution:
python setup.py sdist
-
Publishing:
python setup.py bdist_wheel sdist twine upload dist/*
For TestPyPi publication:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Not working on Git terminal for some reason