-
Notifications
You must be signed in to change notification settings - Fork 238
Creating a PyPi Package for idaes pse
Keith Beattie edited this page Jun 4, 2021
·
5 revisions
Note that pypi will not allow you to replace a package with the same version number (even if you delete the old one). So keep that in mind before uploading a package to either the main or test site.
conda remove --name idaes-rel --all # remove any old conda env
conda create -n idaes-rel python=3.7 # create an entirely new conda env
conda activate idaes-rel
pip install --upgrade setuptools wheel twine
git clone [email protected]:IDAES/idaes-pse.git
cd idaes-pse
git checkout 1.4_rel # Get onto the appropriate branch for the given release
git clean -dfx # If using an existing repo clone
pip install . # build and install idaes-pse in-place (no -e, or -r requirements.txt or setup.py)
pip list # confirm that idaes-pse and pyomo are the expected versions
python setup.py sdist bdist_wheel # create idaes-pse package
# Remove old builds in ./dist/
twine upload --repository-url https://test.pypi.org/legacy/ dist/* # Upload to test pypi
Note that if this is a release candidate, you'll need specify that in the package name here, i.e. idaes-pse==1.7.0rc0
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple idaes-pse
python -c "import idaes; print(idaes.__version__)"
idaes --version
idaes get-extensions # Confirm it is getting the correct version and for the correct OS
idaes get-examples # Confirm it is getting the correct version and writing into the current dir
twine upload dist/*
Edit examples-pse/idaes-compatibility.json directly on the main
branch.
Adding a new mapping for this new version of idaes-pse and what version of examples-pse it should use. This might need to wait until a new version of examples-pse is created, but it's better to have a temp mapping there than none for this version of idaes-pse.
- Set up pre-commit
- Run pytest with coverage report
- Run Pylint locally
- Update the Pyomo version
- Install Pyomo from a local Git clone
- Set up GitHub authentication with GCM
- Handle warnings in pytest