Skip to content

Commit

Permalink
Merge pull request #489 from fast-aircraft-design/poetry-dynamic-vers…
Browse files Browse the repository at this point in the history
…ioning

Using Poetry dynamic versioning
  • Loading branch information
christophe-david committed Apr 19, 2023
2 parents 95ab229 + ca19205 commit a4a35cb
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 79 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: pipx install poetry==${{ vars.POETRY_VERSION }}
run: |
pipx install poetry==${{ vars.POETRY_VERSION }}
pipx inject poetry poetry-dynamic-versioning[plugin]
shell: bash

- name: Poetry path
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH
shell: bash

- name: Set version and build FAST-OAD-core
run: |
poetry version $( echo ${{ github.ref }} | sed 's%refs/tags/%%' )
poetry build
- name: Build FAST-OAD-core
run: poetry build
shell: bash

- name: publish to PyPI
- name: publish FAST-OAD-core to PyPI
env:
TOKEN: ${{ secrets.PyPI }} # do not use the secret directly in run command, it would write it plainly in the log
run: |
Expand All @@ -76,10 +76,7 @@ jobs:
run: |
cd release
cp ../README.md .
export VERSION=$( echo ${{ github.ref }} | sed 's%refs/tags/%%' )
poetry version $VERSION
sed -i 's/fast-oad-core = "^1.3.0"/fast-oad-core = "^'$VERSION'"/' pyproject.toml
poetry build
sed -i "s/0.0.0.0.0/$( poetry version -s )/" pyproject.toml && poetry build
poetry config pypi-token.pypi "$TOKEN"
poetry publish
shell: bash
51 changes: 1 addition & 50 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,35 @@
aenum==3.1.0 ; python_version >= "3.7" and python_version < "4.0"
alabaster==0.7.12 ; python_version >= "3.7" and python_version < "4.0"
anyio==3.3.3 ; python_version >= "3.7" and python_version < "4.0"
appnope==0.1.2 ; python_version >= "3.7" and python_version < "4.0" and platform_system == "Darwin" or python_version >= "3.7" and python_version < "4.0" and sys_platform == "darwin"
argcomplete==1.12.3 ; python_version >= "3.7" and python_version < "3.8.0"
argon2-cffi==21.1.0 ; python_version >= "3.7" and python_version < "4.0"
astroid==2.8.2 ; python_version >= "3.7" and python_version < "4.0"
attrs==21.2.0 ; python_version >= "3.7" and python_version < "4.0"
babel==2.9.1 ; python_version >= "3.7" and python_version < "4.0"
backcall==0.2.0 ; python_version >= "3.7" and python_version < "4.0"
beautifulsoup4==4.11.1 ; python_version >= "3.7" and python_version < "4.0"
black[jupyter]==21.9b0 ; python_version >= "3.7" and python_version < "4.0"
bleach==4.1.0 ; python_version >= "3.7" and python_version < "4.0"
certifi==2021.10.8 ; python_version >= "3.7" and python_version < "4.0"
cffi==1.15.0 ; python_version >= "3.7" and python_version < "4.0"
cfgv==3.3.1 ; python_version >= "3.7" and python_version < "4.0"
charset-normalizer==2.0.7 ; python_version >= "3.7" and python_version < "4.0"
click==8.0.3 ; python_version >= "3.7" and python_version < "4.0"
colorama==0.4.4 ; python_version >= "3.7" and python_version < "4.0" and platform_system == "Windows" or python_version >= "3.7" and python_version < "4.0" and sys_platform == "win32"
coverage==7.0.5 ; python_version >= "3.7" and python_version < "4"
coverage[toml]==7.0.5 ; python_version >= "3.7" and python_version < "4.0"
cycler==0.10.0 ; python_version >= "3.7" and python_version < "4.0"
debugpy==1.5.0 ; python_version >= "3.7" and python_version < "4.0"
decorator==5.1.0 ; python_version >= "3.7" and python_version < "4.0"
defusedxml==0.7.1 ; python_version >= "3.7" and python_version < "4.0"
deprecated==1.2.13 ; python_version >= "3.7" and python_version < "4.0"
distlib==0.3.3 ; python_version >= "3.7" and python_version < "4.0"
docutils==0.17.1 ; python_version >= "3.7" and python_version < "4.0"
ensure==1.0.0 ; python_version >= "3.7" and python_version < "4.0"
entrypoints==0.3 ; python_version >= "3.7" and python_version < "4.0"
exceptiongroup==1.1.0 ; python_version >= "3.7" and python_version < "3.11"
fast-oad-cs25==0.2.0 ; python_version >= "3.7" and python_version < "4.0"
fastjsonschema==2.16.2 ; python_version >= "3.7" and python_version < "4.0"
filelock==3.3.0 ; python_version >= "3.7" and python_version < "4.0"
flake8==4.0.1 ; python_version >= "3.7" and python_version < "4.0"
identify==2.3.0 ; python_version >= "3.7" and python_version < "4.0"
idna==3.3 ; python_version >= "3.7" and python_version < "4.0"
imagesize==1.2.0 ; python_version >= "3.7" and python_version < "4.0"
importlib-metadata==4.2.0 ; python_version >= "3.7" and python_version < "3.10"
iniconfig==1.1.1 ; python_version >= "3.7" and python_version < "4.0"
ipopo==1.0.0 ; python_version >= "3.7" and python_version < "4.0"
ipykernel==6.4.1 ; python_version >= "3.7" and python_version < "4.0"
ipysheet==0.5.0 ; python_version >= "3.7" and python_version < "4.0"
ipython-genutils==0.2.0 ; python_version >= "3.7" and python_version < "4.0"
ipython==7.28.0 ; python_version >= "3.7" and python_version < "4.0"
ipywidgets==7.7.2 ; python_version >= "3.7" and python_version < "4.0"
isort==5.9.3 ; python_version >= "3.7" and python_version < "4.0"
jedi==0.18.0 ; python_version >= "3.7" and python_version < "4.0"
jinja2==3.0.2 ; python_version >= "3.7" and python_version < "4.0"
json5==0.9.6 ; python_version >= "3.7" and python_version < "4.0"
Expand All @@ -58,24 +43,17 @@ jupyterlab-server==2.10.3 ; python_version >= "3.7" and python_version < "4.0"
jupyterlab-widgets==1.1.1 ; python_version >= "3.7" and python_version < "4.0"
jupyterlab==3.4.7 ; python_version >= "3.7" and python_version < "4.0"
kiwisolver==1.3.2 ; python_version >= "3.7" and python_version < "4.0"
latexcodec==2.0.1 ; python_version >= "3.7" and python_version < "4.0"
lazy-object-proxy==1.6.0 ; python_version >= "3.7" and python_version < "4.0"
lxml==4.6.5 ; python_version >= "3.7" and python_version < "4.0"
markupsafe==2.0.1 ; python_version >= "3.7" and python_version < "4.0"
matplotlib-inline==0.1.3 ; python_version >= "3.7" and python_version < "4.0"
matplotlib==3.4.0 ; python_version >= "3.7" and python_version < "4.0"
mccabe==0.6.1 ; python_version >= "3.7" and python_version < "4.0"
mistune==2.0.4 ; python_version >= "3.7" and python_version < "4.0"
mypy-extensions==0.4.3 ; python_version >= "3.7" and python_version < "4.0"
nbclassic==0.3.2 ; python_version >= "3.7" and python_version < "4.0"
nbclient==0.6.3 ; python_version >= "3.7" and python_version < "4.0"
nbconvert==7.0.0 ; python_version >= "3.7" and python_version < "4.0"
nbformat==5.6.1 ; python_version >= "3.7" and python_version < "4.0"
nbstripout==0.6.1 ; python_version >= "3.7" and python_version < "4.0"
nbval==0.10.0 ; python_version >= "3.7" and python_version < "4"
nest-asyncio==1.5.5 ; python_version >= "3.7" and python_version < "4.0"
networkx==2.6.3 ; python_version >= "3.7" and python_version < "4.0"
nodeenv==1.6.0 ; python_version >= "3.7" and python_version < "4.0"
notebook==6.0.0 ; python_version >= "3.7" and python_version < "4.0"
numpy==1.21.0 ; python_version >= "3.7" and python_version < "4.0"
openmdao-extensions==1.1.0 ; python_version >= "3.7" and python_version < "4.0"
Expand All @@ -84,37 +62,24 @@ packaging==21.0 ; python_version >= "3.7" and python_version < "4.0"
pandas==1.1.5 ; python_version >= "3.7" and python_version < "4.0"
pandocfilters==1.5.0 ; python_version >= "3.7" and python_version < "4.0"
parso==0.8.2 ; python_version >= "3.7" and python_version < "4.0"
pathspec==0.9.0 ; python_version >= "3.7" and python_version < "4.0"
pexpect==4.8.0 ; python_version >= "3.7" and python_version < "4.0" and sys_platform != "win32"
pickleshare==0.7.5 ; python_version >= "3.7" and python_version < "4.0"
pillow==8.4.0 ; python_version >= "3.7" and python_version < "4.0"
platformdirs==2.4.0 ; python_version >= "3.7" and python_version < "4.0"
plotly==5.0.0 ; python_version >= "3.7" and python_version < "4.0"
pluggy==1.0.0 ; python_version >= "3.7" and python_version < "4.0"
pre-commit==2.21.0 ; python_version >= "3.7" and python_version < "4.0"
prometheus-client==0.11.0 ; python_version >= "3.7" and python_version < "4.0"
prompt-toolkit==3.0.20 ; python_version >= "3.7" and python_version < "4.0"
ptyprocess==0.7.0 ; python_version >= "3.7" and python_version < "4.0" and os_name != "nt" or python_version >= "3.7" and python_version < "4.0" and sys_platform != "win32"
py==1.10.0 ; python_version >= "3.7" and python_version < "4.0" and implementation_name == "pypy"
pybtex-docutils==1.0.1 ; python_version >= "3.7" and python_version < "4.0"
pybtex==0.24.0 ; python_version >= "3.7" and python_version < "4.0"
pycodestyle==2.8.0 ; python_version >= "3.7" and python_version < "4.0"
pycparser==2.20 ; python_version >= "3.7" and python_version < "4.0"
pydoe2==1.3.0 ; python_version >= "3.7" and python_version < "4.0"
pyflakes==2.4.0 ; python_version >= "3.7" and python_version < "4.0"
pygments==2.10.0 ; python_version >= "3.7" and python_version < "4.0"
pylint==2.11.1 ; python_version >= "3.7" and python_version < "4.0"
pyparsing==2.4.7 ; python_version >= "3.7" and python_version < "4.0"
pyrsistent==0.18.0 ; python_version >= "3.7" and python_version < "4.0"
pytest-cov==4.0.0 ; python_version >= "3.7" and python_version < "4.0"
pytest==7.2.1 ; python_version >= "3.7" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.7" and python_version < "4.0"
pytz==2021.3 ; python_version >= "3.7" and python_version < "4.0"
pywin32==302 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.7" and python_version < "4.0"
pywinpty==1.1.4 ; python_version >= "3.7" and python_version < "4.0" and os_name == "nt"
pyyaml==6.0 ; python_version >= "3.7" and python_version < "4.0"
pyzmq==22.3.0 ; python_version >= "3.7" and python_version < "4.0"
regex==2021.10.8 ; python_version >= "3.7" and python_version < "4.0"
requests==2.26.0 ; python_version >= "3.7" and python_version < "4.0"
ruamel-yaml-clib==0.2.6 ; platform_python_implementation == "CPython" and python_version < "3.8" and python_version >= "3.7"
ruamel-yaml==0.16.0 ; python_version >= "3.7" and python_version < "4.0"
Expand All @@ -123,33 +88,19 @@ send2trash==1.8.0 ; python_version >= "3.7" and python_version < "4.0"
setuptools==67.6.0 ; python_version >= "3.7" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.7" and python_version < "4.0"
sniffio==1.2.0 ; python_version >= "3.7" and python_version < "4.0"
snowballstemmer==2.1.0 ; python_version >= "3.7" and python_version < "4.0"
soupsieve==2.3.2.post1 ; python_version >= "3.7" and python_version < "4.0"
sphinx-rtd-theme==1.0.0 ; python_version >= "3.7" and python_version < "4.0"
sphinx==4.2.0 ; python_version >= "3.7" and python_version < "4.0"
sphinxcontrib-applehelp==1.0.2 ; python_version >= "3.7" and python_version < "4.0"
sphinxcontrib-bibtex==2.4.1 ; python_version >= "3.7" and python_version < "4.0"
sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.7" and python_version < "4.0"
sphinxcontrib-htmlhelp==2.0.0 ; python_version >= "3.7" and python_version < "4.0"
sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.7" and python_version < "4.0"
sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.7" and python_version < "4.0"
sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.7" and python_version < "4.0"
stdatm==0.1.0 ; python_version >= "3.7" and python_version < "4.0"
tabulate==0.8.9 ; python_version >= "3.7" and python_version < "4.0"
tenacity==8.0.1 ; python_version >= "3.7" and python_version < "4.0"
terminado==0.12.1 ; python_version >= "3.7" and python_version < "4.0"
tinycss2==1.1.1 ; python_version >= "3.7" and python_version < "4.0"
tokenize-rt==4.1.0 ; python_version >= "3.7" and python_version < "4.0"
toml==0.10.2 ; python_version >= "3.7" and python_version < "4.0"
tomli-w==1.0.0 ; python_version >= "3.7" and python_version < "4.0"
tomli==1.2.1 ; python_version >= "3.7" and python_version < "4.0"
tomlkit==0.5.3 ; python_version >= "3.7" and python_version < "4.0"
tornado==6.1 ; python_version >= "3.7" and python_version < "4.0"
traitlets==5.1.0 ; python_version >= "3.7" and python_version < "4.0"
typed-ast==1.4.3 ; python_version >= "3.7" and python_version < "3.8"
typing-extensions==3.10.0.2 ; python_version >= "3.7" and python_version < "4.0"
typing-extensions==3.10.0.2 ; python_version >= "3.7" and python_version < "3.8"
urllib3==1.26.7 ; python_version >= "3.7" and python_version < "4"
virtualenv==20.16.2 ; python_version >= "3.7" and python_version < "4.0"
wcwidth==0.2.5 ; python_version >= "3.7" and python_version < "4.0"
webencodings==0.5.1 ; python_version >= "3.7" and python_version < "4.0"
websocket-client==1.2.1 ; python_version >= "3.7" and python_version < "4.0"
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 18 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,26 @@ pyDOE2 = "^1.3.0"
[tool.poetry.extras]
mpi4py = ["mpi4py"]

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
fast-oad-cs25 = ">=0.2"
matplotlib = "^3.1.2"

[tool.poetry.group.test.dependencies]
pytest = "^7.2"
pytest-cov = "^4.0"
coverage = { extras = ["toml"], version = "^7.0" }
pre-commit = "^2.14.1"
black = { version = "21.9b0", extras = ["jupyter"], allow-prereleases = true }
pylint = "^2.10.2"
nbval = "^0.10"

[tool.poetry.group.doc.dependencies]
sphinx = "^4.1.2"
sphinx-rtd-theme = "^1.0"
sphinxcontrib-bibtex = "^2.3.0"

[tool.poetry.group.lint.dependencies]
pre-commit = "^2.14.1"
black = { version = "21.9b0", extras = ["jupyter"], allow-prereleases = true }
pylint = "^2.10.2"
flake8 = "^4.0.1"
matplotlib = "^3.1.2"
nbstripout = "^0.6.0"

[tool.poetry.scripts]
Expand All @@ -95,9 +101,14 @@ fast-oad = "fastoad.cmd.cli:fast_oad"
[tool.poetry.plugins."fastoad.plugins"]
"bundled" = "fastoad"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.black]
line-length = 100
Expand Down
19 changes: 9 additions & 10 deletions release/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "FAST-OAD"
version = "1.3.0.post0" # This version number is overwritten by GitHub packaging workflow but setting 1.3 here will allow installation of CS25 models in development mode
version = "1.4.2" # This version number is overwritten by GitHub packaging workflow but setting 1.3 here will allow installation of CS25 models in development mode
description = "FAST-OAD is a framework for performing rapid Overall Aircraft Design"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -34,19 +34,18 @@ classifiers = [
]

[tool.poetry.dependencies]
# IMPORTANT: when modifying this list, docs/requirements.txt must be updated for
# ReadTheDocs to be able to compile the documentation.
# A pre-commit hook has been added to do this task. As a result, any modification
# of poetry.lock file will modify docs/requirements.txt and make
# the commit fail because "files were modified by this hook". In that case,
# doing again the commit including changes in docs/requirements.txt will succeed.
python = "^3.7"
fast-oad-core = "^1.3.0"
fast-oad-core = "^0.0.0.0.0"
fast-oad-cs25 = ">=0.1.4"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.black]
line-length = 100
Expand Down

0 comments on commit a4a35cb

Please sign in to comment.