@@ -20,42 +20,38 @@ export LANG="C.UTF-8"
20
20
# Prevent virtualenv from auto-updating pip to an incompatible version
21
21
export VIRTUALENV_NO_DOWNLOAD=1
22
22
23
+ # TODO: in the future, we could use an implementation of
24
+ # https://github.com/python-poetry/poetry/issues/3527
25
+ # https://github.com/pypa/pip/issues/8085
26
+ # to select the lowest possible versions, rather than resorting to this sed script.
27
+
23
28
# Patch the project definitions in-place:
24
29
# - Replace all lower and tilde bounds with exact bounds
25
- # - Make the pyopenssl 17.0, which is the oldest version that works with
26
- # a `cryptography` compiled against OpenSSL 1.1 .
30
+ # - Make the pyopenssl 17.0, which can work against an
31
+ # OpenSSL 1.1 compiled cryptography (as older ones don't compile on Travis) .
27
32
# - Delete all lines referring to psycopg2 --- so no testing of postgres support.
28
33
# - Omit systemd: we're not logging to journal here.
29
34
30
- # TODO: we should also replace caret bounds, see
31
- # https://python-poetry.org/docs/dependency-specification/#version-constraints
32
- # We don't use these yet, but they are the default bound used when you `poetry add` from
33
- # the commandline, rather than editing pyproject.toml directly.
35
+ # TODO: also replace caret bounds, see https://python-poetry.org/docs/dependency-specification/#version-constraints
36
+ # We don't use these yet, but IIRC they are the default bound used when you `poetry add`.
34
37
# The sed expression 's/\^/==/g' ought to do the trick. But it would also change
35
- # `python = "^3.7"` to `python = "==3.7"` , which would mean we fail because olddeps
38
+ # `python = "^3.7"` to `python = "==3.7", which would mean we fail because olddeps
36
39
# runs on 3.8 (#12343).
37
40
38
- # TODO: I'd prefer to use something like this
39
- # https://github.com/python-poetry/poetry/issues/3527
40
- # https://github.com/pypa/pip/issues/8085
41
- # rather than this sed script.
42
-
43
41
sed -i-backup \
44
42
-e " s/[~>]=/==/g" \
45
43
-e " /psycopg2/d" \
46
44
-e ' s/pyOpenSSL = "==16.0.0"/pyOpenSSL = "==17.0.0"/' \
47
- -e ' /psycopg2/d' \
48
45
-e ' /systemd/d' \
49
46
pyproject.toml
50
47
51
- # TODO: once pyproject.toml uses poetry-core as its build-system, we may be able to
52
- # simply `pip install .[all, test]` and run trial directly. (We would have to convince
53
- # ourselves that pip will refuse to install if the olddeps are incompatible with each
54
- # other: folklore contends that pip's resolver is more lax than poetry's.)
48
+ # Use poetry to do the installation. This ensures that the versions are all mutually
49
+ # compatible (as far the package metadata declares, anyway); pip's package resolver
50
+ # is more lax.
55
51
#
56
- # Until then, setuptools is the build system. That means we need to use `poetry` to
57
- # do the installation. `poetry lock` fails because of incompatibilities between dev
58
- # dependencies and old deps. Workaround this by removing dev dependencies entirely .
52
+ # Rather than `poetry install --no-dev`, we drop all dev dependencies from the
53
+ # toml file. This means we don't have to ensure compatibility between old deps and
54
+ # dev tools .
59
55
60
56
pip install --user toml
61
57
0 commit comments