Skip to content

Commit 9722e05

Browse files
Update pyproject.toml to be compatible with other standard Python packaging tools (#19137)
1 parent 2c91896 commit 9722e05

File tree

4 files changed

+331
-361
lines changed

4 files changed

+331
-361
lines changed

.ci/scripts/prepare_old_deps.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,23 @@ export VIRTUALENV_NO_DOWNLOAD=1
1616
# to select the lowest possible versions, rather than resorting to this sed script.
1717

1818
# Patch the project definitions in-place:
19-
# - Replace all lower and tilde bounds with exact bounds
20-
# - Replace all caret bounds---but not the one that defines the supported Python version!
21-
# - Delete all lines referring to psycopg2 --- so no testing of postgres support.
19+
# - `-E` use extended regex syntax.
20+
# - Don't modify the line that defines required Python versions.
21+
# - Replace all lower and tilde bounds with exact bounds.
22+
# - Replace all caret bounds with exact bounds.
23+
# - Delete all lines referring to psycopg2 - so no testing of postgres support.
2224
# - Use pyopenssl 17.0, which is the oldest version that works with
2325
# a `cryptography` compiled against OpenSSL 1.1.
2426
# - Omit systemd: we're not logging to journal here.
2527

26-
sed -i \
27-
-e "s/[~>]=/==/g" \
28-
-e '/^python = "^/!s/\^/==/g' \
29-
-e "/psycopg2/d" \
30-
-e 's/pyOpenSSL = "==16.0.0"/pyOpenSSL = "==17.0.0"/' \
31-
-e '/systemd/d' \
32-
pyproject.toml
28+
sed -i -E '
29+
/^\s*requires-python\s*=/b
30+
s/[~>]=/==/g
31+
s/\^/==/g
32+
/psycopg2/d
33+
s/pyOpenSSL\s*==\s*16\.0\.0"/pyOpenSSL==17.0.0"/
34+
/systemd/d
35+
' pyproject.toml
3336

3437
echo "::group::Patched pyproject.toml"
3538
cat pyproject.toml

changelog.d/19137.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update `pyproject.toml` project metadata to be compatible with standard Python packaging tooling.

0 commit comments

Comments
 (0)