python-poetry / python-poetry/poetry
Make "poetry check" also check the scripts
Open
Nobody has claimed this yet.
area/scripts
kind/feature
status/triage
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request
Please check the scripts section
When I added the following pyproject.toml to my toy project mpu:
[tool.poetry]
name = "mpu"
version = "0.1.0"
description = ""
authors = ["Martin Thoma <info@martin-thoma.de>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
awscli = "^1.18.172"
pydantic = "^1.7.2"
click = "^7.1.2"
numpy = "^1.19.4"
scipy = "^1.5.4"
pandas = "^1.1.4"
typing-extensions = "^3.7.4"
[tool.poetry.dev-dependencies]
[tool.poetry.scripts]
poetry = "mpu.cli:entry_point"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Please note that mpu.cli does not exist, but I still get:
poetry install
Creating virtualenv mpus-d5ZJE7ws-py3.8 in /home/moose/.cache/pypoetry/virtualenvs
Installing dependencies from lock file
Package operations: 19 installs, 0 updates, 0 removals
• Installing six (1.15.0)
• Installing jmespath (0.10.0)
• Installing python-dateutil (2.8.1)
• Installing urllib3 (1.25.11)
• Installing botocore (1.19.12)
• Installing pyasn1 (0.4.8)
• Installing colorama (0.4.3)
• Installing docutils (0.15.2)
• Installing numpy (1.19.4)
• Installing pytz (2020.4)
• Installing pyyaml (5.3.1)
• Installing rsa (4.5)
• Installing s3transfer (0.3.3)
• Installing awscli (1.18.172)
• Installing click (7.1.2)
• Installing pandas (1.1.4)
• Installing pydantic (1.7.2)
• Installing scipy (1.5.4)
• Installing typing-extensions (3.7.4.3)
This looks as if everything is fine, but when I try to run it, I get:
$ poetry run mpu
FileNotFoundError
[Errno 2] No such file or directory
at ~/.pyenv/versions/3.8.5/lib/python3.8/os.py:601 in _execvpe
597│ path_list = map(fsencode, path_list)
598│ for dir in path_list:
599│ fullname = path.join(dir, file)
600│ try:
→ 601│ exec_func(fullname, *argrest)
602│ except (FileNotFoundError, NotADirectoryError) as e:
603│ last_exc = e
604│ except OSError as e:
605│ last_exc = e
Same for poetry check:
poetry check
All set!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the implementation of the poetry check command and the script configuration shown in the issue. Reproduce the example with the missing mpu.cli target, then verify that poetry check reports the invalid script instead of saying “All set!”.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100