Skip to content

Commit e482845

Browse files
committed
fix: Further Python packaging improvements with new build system
1 parent bdaf4d9 commit e482845

4 files changed

Lines changed: 60 additions & 18 deletions

File tree

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ safety/manual:
223223
- .rules/build-wheel
224224
script:
225225
- poetry run python run-ci.py --isolate-conan-user-home prepare --remote $CONAN_REMOTE --use-tanker=deployed --tanker-ref $SDK_NATIVE_CONAN_REFERENCE --profile $CONAN_PROFILE
226-
- poetry run python run-ci.py --isolate-conan-user-home build --release $SDK_PYTHON_RELEASE_VERSION
226+
- poetry run python run-ci.py build --release $SDK_PYTHON_RELEASE_VERSION
227227
artifacts:
228228
paths:
229229
- dist

poetry.lock

Lines changed: 48 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name = "tankersdk"
33
version = "0.0.0"
44
description = "Python client fo Tanker"
55
authors = [{ name = "Tanker team" }]
6+
requires-python = ">=3.10"
7+
dependencies = [
8+
"cffi >= 1.13.2, < 2.0.0a0",
9+
"attrs >= 19.3.0, < 20.0.0a0",
10+
"typing_extensions >= 3.7.4, < 4.0.0a0",
11+
]
612

713
[tool.poetry]
814
name = "tankersdk"
@@ -11,7 +17,7 @@ description = "Python client fo Tanker"
1117
authors = ["Tanker team"]
1218

1319
[tool.poetry.dependencies]
14-
python = "^3.11"
20+
python = "^3.10"
1521
cffi = "^1.13.2"
1622
attrs = "^19.3.0"
1723
typing_extensions = "^3.7.4"
@@ -20,6 +26,7 @@ typing_extensions = "^3.7.4"
2026
# CI/CD
2127
tankerci = { version = ">= 2023.1.4627", source = "gitlab" }
2228
twine = "^3.2.0"
29+
build = "^0.10.0"
2330

2431
# linters
2532
black = "22.3.0"
@@ -53,7 +60,7 @@ secondary = true
5360
packages = ["tankersdk"]
5461

5562
[tool.distutils.bdist_wheel]
56-
py-limited-api = "cp39"
63+
py-limited-api = "cp310"
5764

5865
[build-system]
5966
requires = ["poetry-core>=1.0.0", "path", "setuptools>=61", "cffi >= 1.12", "build >= 0.10.0"]

run-ci.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def build_wheel(version: str) -> None:
6969
# so that they can be found even when the working directory
7070
# changes, and we make sure *all* paths used in build_tanker.py
7171
# are absolute
72-
tankerci.run("poetry", "run", "python", "-m", "build", "--wheel", env=env)
72+
tankerci.run("poetry", "run", "python", "-Im", "build", "--wheel", env=env)
7373
wheels = list(dist_path.glob("tankersdk-*.whl"))
7474
if len(wheels) != 1:
7575
raise Exception("multiple wheels found: {}".format(wheels))
@@ -100,7 +100,7 @@ def run_test() -> None:
100100

101101
def build(release_version: Optional[str], test: bool) -> None:
102102
# Installs the dependencies (and the pure-python part of the package, without the C extension)
103-
tankerci.run("poetry", "install", cwd=Path.cwd())
103+
tankerci.run("poetry", "install", "--no-root", cwd=Path.cwd())
104104
# Builds a local version of the package (a wheel) and installs it inside the poetry virtualenv
105105
tankerci.run("poetry", "run", "pip", "install", ".", cwd=Path.cwd())
106106

0 commit comments

Comments
 (0)