question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setup.cfg: entry_points keys are made lowercase

See original GitHub issue

This breaks when the entry point is actually case-sensitive.

  1. git clone https://github.com/pydoit/doit-plugin-sample
  2. Delete setup.py, use the following setup.cfg:
[metadata]
name = doit-plugin-sample
description = a simple doit command plugin

[options]
py_modules = 
    doit_sample_cmd
install_requires = 
    doit

[options.entry_points]
doit.COMMAND =
    plug_sample = doit_sample_cmd:SampleCmd
  1. Use this pyproject.toml:
[build-system]
requires = ["setuptools>=30.3.0", "wheel"]
  1. pip install . inside a venv.

Inspecting venv/*/site-packages/doit_plugin_sample-0.0.0.dist-info/entry_points.txt:

[doit.command]
plug_sample = doit_sample_cmd:SampleCmd

This will not work, as the entry point is doit.COMMAND.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jaracocommented, Feb 22, 2021

I created the repro as jaraco/doit-plugin-sample@setuptools/1937.

draft $ git clone gh://pydoit/doit-plugin-sample
Cloning into 'doit-plugin-sample'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 7 (delta 1), reused 7 (delta 1), pack-reused 0
Receiving objects: 100% (7/7), done.
Resolving deltas: 100% (1/1), done.
draft $ cd doit-plugin-sample/
doit-plugin-sample master $ hub fork
Updating jaraco
From https://github.com/pydoit/doit-plugin-sample
 * [new branch]      master     -> jaraco/master
new remote: jaraco
doit-plugin-sample master $ git checkout -b setuptools/1937
Switched to a new branch 'setuptools/1937'
doit-plugin-sample setuptools/1937 $ git rm setup.py
rm 'setup.py'
doit-plugin-sample setuptools/1937 $ cat > setup.cfg
[metadata]
name = doit-plugin-sample
description = a simple doit command plugin

[options]
py_modules = 
    doit_sample_cmd
install_requires = 
    doit

[options.entry_points]
doit.COMMAND =
    plug_sample = doit_sample_cmd:SampleCmd
doit-plugin-sample setuptools/1937 $ cat > pyproject.toml
[build-system]
requires = ["setuptools>=30.3.0", "wheel"]
doit-plugin-sample setuptools/1937 $ git add .
doit-plugin-sample setuptools/1937 $ git commit -a -m "Alter project as described in pypa/setuptools#1937"
[setuptools/1937 6a47e86] Alter project as described in pypa/setuptools#1937
 2 files changed, 15 insertions(+), 17 deletions(-)
 create mode 100644 pyproject.toml
 rewrite setup.py (99%)
 mode change 100755 => 100644
doit-plugin-sample setuptools/1937 $ git push jaraco
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 605 bytes | 605.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
remote: 
remote: Create a pull request for 'setuptools/1937' on GitHub by visiting:
remote:      https://github.com/jaraco/doit-plugin-sample/pull/new/setuptools/1937
remote: 
To github.com:jaraco/doit-plugin-sample.git
 * [new branch]      setuptools/1937 -> setuptools/1937

With that, I’m able to demonstrate how the doit plugin works when running under the HEAD of the repo (7f56bc5):

draft $ touch dodo.py
draft $ pip-run -q --use-pep517 doit git+https://github.com/pydoit/doit-plugin-sample@7f56bc5 setuptools -- -m doit plug_sample
  WARNING: Did not find branch or tag '7f56bc5', assuming revision or ref.
This sample command does nothing!

And fails when running under the fork version:

draft $ pip-run -q --use-pep517 doit git+https://github.com/jaraco/doit-plugin-sample@setuptools/1937 setuptools -- -m doit plug_sample
ERROR: Invalid parameter: "plug_sample". Must be a command, task, or a target.
Type "-m help" to see available commands.
Type "-m list" to see available tasks.
1reaction
melissa-kun-licommented, Feb 23, 2021

I’ll take this on 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Demystefying Setuptools Entry Points - YouTube
With just a few lines of code in your ` setup. py ` file, you can install command-line applications, inject features into other...
Read more >
How are entrypoints of the Python standard library registered?
The entry points are listed in entry_points.txt files for each of the packages. For example: $ find /path/to/envs/py38/lib/python3.8/ -name ...
Read more >
wheel Documentation - Read the Docs
The wheel will go to dist/yourproject-<tags>.whl. If you want to make universal (Python 2/3 compatible, pure Python) wheels, add the following ...
Read more >
Entry Points - setuptools 65.6.3.post20221220 documentation
First consider an example without entry points. Imagine a package defined thus: project_root_directory ├── pyproject.toml # and/or setup.cfg, setup.py └ ...
Read more >
Dockerfile reference - Docker Documentation
The instruction is not case-sensitive. However, convention is for them to be UPPERCASE to distinguish them from arguments more easily. Docker runs instructions ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found