Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] tool.flit.scripts is not extracted as entry_points #269

Closed
BastianZim opened this issue Dec 10, 2021 · 10 comments · Fixed by #493
Closed

[BUG] tool.flit.scripts is not extracted as entry_points #269

BastianZim opened this issue Dec 10, 2021 · 10 comments · Fixed by #493
Labels
bug Something isn't working

Comments

@BastianZim
Copy link
Contributor

BastianZim commented Dec 10, 2021

Describe the bug
A clear and concise description of what the bug is.

This is not 100% confirmed but currently the assumption is that [tool.flit.scripts] in a pyproject.toml file is the same as entry_points. This is not extracted.

To Reproduce
Steps to reproduce the behavior:

  1. Run Grayskull on package using pyproject.toml.
  2. No entry_points are created.

Expected behavior
A clear and concise description of what you expected to happen.

entry_points are extracted correctly.

Outputs
If applicable, add the output to help explain your problem.

Can be tried with yaqc-qtpy.

Additional context
Add any other context about the problem here.

Ref about it being equal: https://gitter.im/conda-forge/conda-forge.github.io?at=6026b6e7063b6c68d55680a7
Sample package that has the new scripts: https://gitlab.com/yaq/yaqc-qtpy/-/blob/main/pyproject.toml#L33

@BastianZim BastianZim added the bug Something isn't working label Dec 10, 2021
@bollwyvl
Copy link

bollwyvl commented Apr 7, 2022

Maybe now that PEP 517 metadata is supported (and starting to be used by more than just flit) we can start looking at that as the intermediate representation?

https://flit.pypa.io/en/latest/pyproject_toml.html#scripts-section

[project.scripts]
flit = "flit:main"

at that point, supporting a legacy "pun" for the name wouldn't be that hard.

@BastianZim
Copy link
Contributor Author

Yeah but we need to figure out what exactly the equivalent is because flit also has https://flit.pypa.io/en/latest/pyproject_toml.html#entry-points-sections

Maybe https://flit.pypa.io/en/latest/pyproject_toml.html#scripts-section is scripts from setup.py? In that case it can't be noarch.

@bollwyvl
Copy link

bollwyvl commented Apr 7, 2022 via email

@BastianZim
Copy link
Contributor Author

Oh yeah – missed that. Would make the most sense then, agreed.

@dholth
Copy link
Contributor

dholth commented Mar 27, 2023

You could build the wheel or otherwise generate the metadata, and parse scripts out of entry_points.txt

@marcelotrevisani
Copy link
Member

marcelotrevisani commented Sep 20, 2023

Should we close this? or is it still a problem? I am a bit confused here, sorry 😄

@BastianZim
Copy link
Contributor Author

I think it's still a problem.

In short: Pyproject.toml flit uses [tool.flit.scripts] for entry_points.

This example: https://gitlab.com/yaq/yaqc-qtpy/-/blob/main/pyproject.toml#L42 is not converted into an entry_points but it should.

The confusion above came because I wasn't 100% sure if pyproject.toml[tool.flit.scripts] are the same as entry_points but I think they are.

@dholth
Copy link
Contributor

dholth commented Sep 20, 2023

You could have it do the build and take the entry points out of dist-info.

@marcelotrevisani
Copy link
Member

You could have it do the build and take the entry points out of dist-info.

the only problem is that, I would prefer to avoid in creating the whole build, because grayskull just start the build and stop it after it gets all the metadata, that is for setup.py and related. For pyproject.toml I am pretty much parsing the toml file as it is faster and simple to do.

@marcelotrevisani marcelotrevisani linked a pull request Sep 21, 2023 that will close this issue
@marcelotrevisani
Copy link
Member

With this PR I was able to generate the following recipe for yaqc-qtpy

grayskull pypi yaqc-qtpy --strict-conda-forge
{% set name = "yaqc-qtpy" %}
{% set version = "2022.6.0" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/yaqc-qtpy-{{ version }}.tar.gz
  sha256: 6a6b73fb3179882bc46a18a1de9fc6c8ced2fffb8d0f5e00ed816a8d598a4ead

build:
  entry_points:
    - yaqc-qtpy = yaqc_qtpy.__main__:main
  noarch: python
  script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
  number: 0

requirements:
  host:
    - python >=3.7
    - flit-core >=2,<4
    - pip
  run:
    - python >=3.7
    - yaqd-core >=2020.06.3
    - yaqc
    - yaq-traits
    - yaqd-control
    - click
    - qtpy
    - qtypes >=2022.6.0
    - pyqtgraph
    - pyside2
    - numpy
    - qtconsole

test:
  imports:
    - yaqc_qtpy
  commands:
    - pip check
    - yaqc-qtpy --help
  requires:
    - pip

about:
  home: https://yaq.fyi
  summary: Tooling for building simple yaq clients using qtpy.
  dev_url: https://github.com/yaq-project/yaqc-qtpy
  license: LGPL-3.0 AND CC0-1.0
  license_file:
    - LICENSE
    - yaqc_qtpy/splash-images/LICENSE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants