Skip to content

Why semantic-release delete most part of pyproject.toml  #338

@BrambleXu

Description

@BrambleXu

semantic_release setup in pyproject.toml:

[tool.poetry]
name = "seqal"
version = "0.1.1"
...

[tool.semantic_release]
version_toml = "pyproject.toml:tool.poetry.version"
version_variable = "seqal/__init__.py:__version__"
branch = "main"
upload_to_pypi = false
upload_to_release = true
build_command = "pip install poetry && poetry build"

semantic_release setup in ci.yml:

  release:
    runs-on: ubuntu-latest
    environment: release
    if: github.ref == 'refs/heads/main'
    needs:
      - test
      - lint
      - commitlint

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Python Semantic Release
        uses: relekang/python-semantic-release@v7.15.0
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          pypi_token: ${{ secrets.PYPI_TOKEN }}

First question: why semantic-release delete most part of pyproject.toml?

Below is the commit changes image that semantic-release delete setup in the pyproject.toml file:

image

Below is the result after the deletion. Other setups ([tool.poetry.dependencies], [tool.poetry.dev-dependencies] ) are gone.

[tool]

[tool.poetry]
version = "0.1.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Another problem is that the CI release is failed. Below is the log.

image


  Downloading shellingham-1.4.0-py2.py3-none-any.whl (9.4 kB)
Collecting html5lib<2.0,>=1.0
  Downloading html5lib-1.1-py2.py3-none-any.whl (112 kB)
Requirement already satisfied: tomlkit<1.0.0,>=0.7.0 in /usr/local/lib/python3.7/site-packages (from poetry) (0.7.2)
Collecting cleo<0.9.0,>=0.8.1
  Downloading cleo-0.8.1-py2.py3-none-any.whl (21 kB)
Requirement already satisfied: requests-toolbelt<0.10.0,>=0.9.1 in /usr/local/lib/python3.7/site-packages (from poetry) (0.9.1)
Collecting cachy<0.4.0,>=0.3.0
  Downloading cachy-0.3.0-py2.py3-none-any.whl (20 kB)
Collecting virtualenv<21.0.0,>=20.0.26
  Downloading virtualenv-20.4.7-py2.py3-none-any.whl (7.2 MB)
Collecting msgpack>=0.5.2
  Downloading msgpack-1.0.2-cp37-cp37m-manylinux1_x86_64.whl (273 kB)
Collecting lockfile>=0.9
  Downloading lockfile-0.12.2-py2.py3-none-any.whl (13 kB)
Collecting pylev<2.0,>=1.3
  Downloading pylev-1.4.0-py2.py3-none-any.whl (6.1 kB)
Collecting pastel<0.3.0,>=0.2.0
  Downloading pastel-0.2.1-py2.py3-none-any.whl (6.0 kB)
Requirement already satisfied: six>=1.9 in /usr/local/lib/python3.7/site-packages (from html5lib<2.0,>=1.0->poetry) (1.16.0)
Requirement already satisfied: webencodings in /usr/local/lib/python3.7/site-packages (from html5lib<2.0,>=1.0->poetry) (0.5.1)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/site-packages (from importlib-metadata<2.0.0,>=1.6.0->poetry) (3.4.1)
Requirement already satisfied: SecretStorage>=3.2 in /usr/local/lib/python3.7/site-packages (from keyring<22.0.0,>=21.2.0->poetry) (3.3.1)
Requirement already satisfied: jeepney>=0.4.2 in /usr/local/lib/python3.7/site-packages (from keyring<22.0.0,>=21.2.0->poetry) (0.6.0)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.7/site-packages (from packaging<21.0,>=20.4->poetry) (2.4.7)
Collecting ptyprocess>=0.5
  Downloading ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/site-packages (from requests<3.0,>=2.18->poetry) (2021.5.30)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.7/site-packages (from requests<3.0,>=2.18->poetry) (1.26.5)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/site-packages (from requests<3.0,>=2.18->poetry) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.7/site-packages (from requests<3.0,>=2.18->poetry) (4.0.0)
Requirement already satisfied: cryptography>=2.0 in /usr/local/lib/python3.7/site-packages (from SecretStorage>=3.2->keyring<22.0.0,>=21.2.0->poetry) (3.4.7)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.7/site-packages (from cryptography>=2.0->SecretStorage>=3.2->keyring<22.0.0,>=21.2.0->poetry) (1.14.5)
Requirement already satisfied: pycparser in /usr/local/lib/python3.7/site-packages (from cffi>=1.12->cryptography>=2.0->SecretStorage>=3.2->keyring<22.0.0,>=21.2.0->poetry) (2.20)
Collecting appdirs<2,>=1.4.3
  Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting filelock<4,>=3.0.0
  Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB)
Collecting distlib<1,>=0.3.1
  Downloading distlib-0.3.2-py2.py3-none-any.whl (338 kB)
Installing collected packages: pylev, pastel, msgpack, crashtest, ptyprocess, lockfile, importlib-metadata, filelock, distlib, clikit, cachecontrol, appdirs, virtualenv, shellingham, poetry-core, pexpect, keyring, html5lib, cleo, cachy, poetry
  Attempting uninstall: importlib-metadata
    Found existing installation: importlib-metadata 4.5.0
    Uninstalling importlib-metadata-4.5.0:
      Successfully uninstalled importlib-metadata-4.5.0
  Attempting uninstall: keyring
    Found existing installation: keyring 23.0.1
    Uninstalling keyring-23.0.1:
      Successfully uninstalled keyring-23.0.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
Successfully installed appdirs-1.4.4 cachecontrol-0.12.6 cachy-0.3.0 cleo-0.8.1 clikit-0.6.2 crashtest-0.3.1 distlib-0.3.2 filelock-3.0.12 html5lib-1.1 importlib-metadata-1.7.0 keyring-21.8.0 lockfile-0.12.2 msgpack-1.0.2 pastel-0.2.1 pexpect-4.8.0 poetry-1.1.6 poetry-core-1.0.3 ptyprocess-0.7.0 pylev-1.4.0 shellingham-1.4.0 virtualenv-20.4.7
twine 3.4.1 requires importlib-metadata>=3.6, but you have importlib-metadata 1.7.0 which is incompatible.
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv

  RuntimeError

  The Poetry configuration is invalid:
    - 'name' is a required property
    - 'description' is a required property
  

  at /usr/local/lib/python3.7/site-packages/poetry/core/factory.py:43 in create_poetry
       39│             message = ""
       40│             for error in check_result["errors"]:
       41│                 message += "  - {}\n".format(error)
       42│ 
    →  43│             raise RuntimeError("The Poetry configuration is invalid:\n" + message)
       44│ 
       45│         # Load package
       46│         name = local_config["name"]
       47│         version = local_config["version"]
error: Encountered a bad command exit code!
error: 
error: Command: 'pip install poetry && poetry build'
error: 
error: Exit code: 1
error: 
error: Stdout: already printed
error: 
error: Stderr: already printed
error: 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions