mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 13:47:12 -05:00
Replace legacy setup.py packaging with modern pyproject.toml (PEP 517/518/621). Version is dynamically resolved via setuptools attr: directive from rips/_version.py, which CMake generates. Consolidate requirements.txt, dev-requirements.txt, and build-requirements.txt into pyproject.toml dependencies and [dev] optional-dependencies. Consolidate rips/mypy.ini into [tool.mypy] section of pyproject.toml. Update GitHub Actions workflow and CMakeLists.txt accordingly.
27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
######################################################################
|
|
# All this is based on the MANIFEST.in and pyproject.toml in Python-folder
|
|
######################################################################
|
|
|
|
# 1. Make sure dist folder is clear
|
|
del dist/*
|
|
|
|
# 2. Update rips-version tag in rips/_version.py (".N after ResInsight version"). This is generated from rips/_version.py.cmake
|
|
# So that you for instance have version 2019.08.1 of rips.
|
|
|
|
# 3. Build source distribution
|
|
python -m build
|
|
|
|
# 4. Test upload to test.pypi.org. This requires a ResInsight testpypi-user and you will be prompted for username and password
|
|
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
|
|
|
|
# 5. Test install rips module.
|
|
pip install --index-url https://test.pypi.org/simple/ rips
|
|
|
|
# 6. Test the newly installed module
|
|
|
|
# 8. If anything is wrong, start again from 1. with an incremented rips-version (ResInsightVersion.2+)
|
|
# These incremented versions are just for testpypi and you can reset back to the wanted version before real upload
|
|
|
|
# 9. Upload to real Pypi. This requires a ResInsight pypi-user.
|
|
python -m twine upload dist/*
|