Skip to content

Commit

Permalink
updated build backend (#7502)
Browse files Browse the repository at this point in the history
* updated build backend

* use poetry_version.txt for the ci poetry version

* set ubuntu version

Co-authored-by: Joseph Juzl <joejuzl@gmail.com>
  • Loading branch information
tmbo and joejuzl committed Jan 28, 2021
1 parent 9379a22 commit c6e32f6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/poetry_version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The poetry version is stored in a separate file due to the https://github.com/python-poetry/poetry/issues/3316
poetry-version=1.1.4
2 changes: 1 addition & 1 deletion .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ jobs:
docker:
name: Build Docker
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [changes, build_docker_base_images_and_set_env]
env:
IMAGE_TAG: ${{ needs.build_docker_base_images_and_set_env.outputs.image_tag }}
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[build-system]
# keep this in sync with the version in pyproject.toml and Dockerfile.base
requires = [ "poetry>=1.1.4",]
build-backend = "poetry.masonry.api"
requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
Expand Down
10 changes: 7 additions & 3 deletions scripts/poetry-version.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/usr/bin/env python

"""Extract the poetry version from pyproject.toml. Used in e.g. github workflows."""
"""Extract the poetry version from .github/poetry_version.txt. Used in e.g. github workflows."""

import pathlib
import sys
import re

# The poetry version is stored in the .github/poetry_version.txt file due to the https://github.com/python-poetry/poetry/issues/3316
poetry_version_txt = pathlib.Path(__file__).parent.parent / ".github" / "poetry_version.txt"

if __name__ == "__main__":
version_regex = r'"poetry[^\"]*=([^\"]+)"'
with open("pyproject.toml") as f:
version_regex = r'poetry-version=(.*)'
with poetry_version_txt.open() as f:
for line in f:
m = re.search(version_regex, line)
if m:
Expand Down

0 comments on commit c6e32f6

Please sign in to comment.