Skip to content

Commit

Permalink
Pin and use preview/beta poetry version
Browse files Browse the repository at this point in the history
There were massive issues with the Dockerfile not building due to:

```
Step 11/13 : RUN poetry config virtualenvs.create false && poetry install --no-dev
 ---> Running in f70d4cf0e420
Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file

Package operations: 30 installs, 0 updates, 1 removal

  • Removing setuptools (63.2.0)
  • Installing pycparser (2.21)
  • Installing cffi (1.15.1)
  • Installing cryptography (37.0.4)
  • Installing dnspython (2.2.1)
  • Installing frozenlist (1.3.0)
  • Installing idna (3.3)
  • Installing multidict (6.0.2)
  • Installing pycares (4.2.1)
  • Installing aiodns (3.0.0)
  • Installing aiosignal (1.2.0)
  • Installing async-timeout (4.0.2)
  • Installing attrs (21.4.0)
  • Installing brotli (1.0.9)
  • Installing cchardet (2.1.7)
  • Installing charset-normalizer (2.1.0)
  • Installing commonmark (0.9.1)
  • Installing email-validator (1.2.1)
  • Installing pygments (2.12.0)
  • Installing pyjwt (2.4.0)

  EnvCommandError

  Command ['/usr/local/bin/pip3.10', 'install', '--no-deps', '/root/.cache/pypoetry/artifacts/19/4b/ee/54a2fb42a3316b07a2e3421088822915d6f931052658578ec1aad977ea/cchardet-2.1.7.tar.gz'] errored with the following return code 1, and output:
  Processing /root/.cache/pypoetry/artifacts/19/4b/ee/54a2fb42a3316b07a2e3421088822915d6f931052658578ec1aad977ea/cchardet-2.1.7.tar.gz
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    error: subprocess-exited-with-error

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [1 lines of output]
        ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
        [end of output]
```

It removed its own dependency, `setuptools` and fails afterwards. This
is because `setuptools` is not part of our dependencies *but it's
installed*, so the environment is 'synchronized' and any extraneous
packages are *removed*. Running this in a virtual environment (instead
of `virtualenvs.create false`) didn't help.

See also python-poetry/poetry#3139

Poetry 1.2 fixes it:
https://python-poetry.org/blog/announcing-poetry-1.2.0a2/#package-operations-and-synchronization-improvements
  • Loading branch information
alexpovel committed Jul 17, 2022
1 parent 308fa80 commit 19f372c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
uses: actions/setup-python@v2
- name: Install Poetry
uses: snok/install-poetry@v1.3.0
with:
version: 1.2.0b3
- name: Build package
run: poetry build
- name: Publish package
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1.3.0
with:
version: 1.2.0b3
- name: Set up Python environment
run: poetry install
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt-get update \
&& apt-get install --no-install-recommends --yes \
curl

RUN curl -sSL https://install.python-poetry.org | python -
RUN curl -sSL https://install.python-poetry.org | python - --version 1.2.0b3

# README.md is junk but poetry requests it and fails otherwise.
COPY pyproject.toml poetry.lock README.md ./
Expand Down

0 comments on commit 19f372c

Please sign in to comment.