Skip to content

Commit 0fd79c8

Browse files
authored
Merge pull request #3207 from valohai/modernize-build
2 parents 3d79ce8 + 047df6b commit 0fd79c8

File tree

5 files changed

+79
-91
lines changed

5 files changed

+79
-91
lines changed

.github/workflows/ci.yml

+13
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ jobs:
1818
- name: Run ruff
1919
run: ruff docker tests
2020

21+
build:
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.x'
28+
- run: pip3 install build && python -m build .
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: dist
32+
path: dist
33+
2134
unit-tests:
2235
runs-on: ubuntu-latest
2336
strategy:

.github/workflows/release.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ jobs:
2626
with:
2727
python-version: '3.x'
2828

29-
- name: Generate Pacakge
29+
- name: Generate Package
3030
run: |
31-
pip3 install setuptools wheel
32-
python setup.py sdist bdist_wheel
31+
pip3 install build
32+
python -m build .
3333
env:
34+
# This is also supported by Hatch; see
35+
# https://github.com/ofek/hatch-vcs#version-source-environment-variables
3436
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DOCKER: ${{ inputs.tag }}
3537

3638
- name: Publish to PyPI

pyproject.toml

+61-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,66 @@
11
[build-system]
2-
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
34

4-
[tool.setuptools_scm]
5-
write_to = 'docker/_version.py'
5+
[project]
6+
name = "docker"
7+
dynamic = ["version"]
8+
description = "A Python library for the Docker Engine API."
9+
readme = "README.md"
10+
license = "Apache-2.0"
11+
requires-python = ">=3.8"
12+
maintainers = [
13+
{ name = "Docker Inc.", email = "[email protected]" },
14+
]
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Environment :: Other Environment",
18+
"Intended Audience :: Developers",
19+
"License :: OSI Approved :: Apache Software License",
20+
"Operating System :: OS Independent",
21+
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3.8",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
28+
"Topic :: Software Development",
29+
"Topic :: Utilities",
30+
]
31+
32+
dependencies = [
33+
"requests >= 2.26.0",
34+
"urllib3 >= 1.26.0",
35+
"pywin32>=304; sys_platform == \"win32\"",
36+
]
37+
38+
[project.optional-dependencies]
39+
ssh = [
40+
"paramiko>=2.4.3",
41+
]
42+
tls = [] # kept for backwards compatibility
43+
websockets = [
44+
"websocket-client >= 1.3.0",
45+
]
46+
47+
[project.urls]
48+
Changelog = "https://docker-py.readthedocs.io/en/stable/change-log.html"
49+
Documentation = "https://docker-py.readthedocs.io"
50+
Homepage = "https://github.com/docker/docker-py"
51+
Source = "https://github.com/docker/docker-py"
52+
Tracker = "https://github.com/docker/docker-py/issues"
53+
54+
[tool.hatch.version]
55+
source = "vcs"
56+
57+
[tool.hatch.build.hooks.vcs]
58+
version-file = "docker/_version.py"
59+
60+
[tool.hatch.build.targets.sdist]
61+
include = [
62+
"/docker",
63+
]
664

765
[tool.ruff]
866
target-version = "py38"

setup.cfg

-3
This file was deleted.

setup.py

-82
This file was deleted.

0 commit comments

Comments
 (0)