Skip to content

Commit

Permalink
feat(core): add a minimum version check to support breaking forward c…
Browse files Browse the repository at this point in the history
…ompatibility
  • Loading branch information
Panaetius committed Apr 14, 2022
1 parent 1ddc16e commit a3ac463
Show file tree
Hide file tree
Showing 12 changed files with 355 additions and 40 deletions.
84 changes: 59 additions & 25 deletions .github/workflows/test_deploy.yml
Expand Up @@ -64,12 +64,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -103,12 +106,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -139,12 +145,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -181,11 +190,14 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
python -m pip install .[all]
- name: Install renku into cache
if: steps.cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand All @@ -199,7 +211,7 @@ jobs:
cd ../..
- name: Publish cheatsheet if changed
id: publish
if: ${{ hashFiles('docs/cheatsheet_hash') != hashFiles('docs/cheatsheet_hash_new') }}
if: ${{ hashFiles('docs/cheatsheet_hash') != hashFiles('docs/cheatsheet_hash_new') }}
run: |
cat docs/cheatsheet_hash
cat docs/cheatsheet_hash_new
Expand Down Expand Up @@ -238,12 +250,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Build Package
env:
POETRY_VIRTUALENVS_CREATE: false
Expand Down Expand Up @@ -281,12 +296,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -336,12 +354,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -397,12 +418,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -458,12 +482,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -540,7 +567,8 @@ jobs:
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
brew install shellcheck node || brew link --overwrite node
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install wheel poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -666,12 +694,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -742,12 +773,15 @@ jobs:
if: steps.dependency-cache.outputs.cache-hit != 'true' || 'refs/heads/master' == github.ref || 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip
python -m pip install coveralls poetry wheel twine
python -m pip install coveralls poetry wheel twine poetry-dynamic-versioning
poetry-dynamic-versioning
make download-templates
python -m pip install .[all]
- name: Install renku into cache
if: steps.dependency-cache.outputs.cache-hit == 'true'
run: python -m pip install --no-deps .
run: |
poetry-dynamic-versioning
python -m pip install --no-deps .
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down Expand Up @@ -882,7 +916,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: 'develop'
ref: "develop"
- name: Set Git config
run: |
git config --global --add user.name "Renku Bot"
Expand Down
28 changes: 21 additions & 7 deletions conftest.py
Expand Up @@ -18,6 +18,8 @@
"""Pytest configuration."""
import importlib

from poetry_dynamic_versioning import _apply_version, _get_pyproject_path, _get_version, _revert_version, get_config

CLI_FIXTURE_LOCATIONS = [
"tests.cli.fixtures.cli_gateway",
"tests.cli.fixtures.cli_kg",
Expand Down Expand Up @@ -61,10 +63,22 @@
INCLUDE_FIXTURES = GLOBAL_FIXTURE_LOCATIONS + CORE_FIXTURE_LOCATIONS + CLI_FIXTURE_LOCATIONS + SERVICE_FIXTURE_LOCATIONS


for _fixture in INCLUDE_FIXTURES:
module = importlib.import_module(_fixture)
globals().update(
{n: getattr(module, n) for n in module.__all__}
if hasattr(module, "__all__")
else {k: v for (k, v) in module.__dict__.items() if not k.startswith("_")}
)
def pytest_configure(config):
"""Set version before tests run."""
poetry_config = get_config()
pyproject_path = _get_pyproject_path()
version = _get_version(poetry_config)
_apply_version(version, poetry_config, pyproject_path)

for _fixture in INCLUDE_FIXTURES:
module = importlib.import_module(_fixture)
globals().update(
{n: getattr(module, n) for n in module.__all__}
if hasattr(module, "__all__")
else {k: v for (k, v) in module.__dict__.items() if not k.startswith("_")}
)


def pytest_unconfigure(config):
"""Revert version to 0.0.0 after tests run."""
_revert_version()
51 changes: 48 additions & 3 deletions poetry.lock

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

0 comments on commit a3ac463

Please sign in to comment.