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] Mypy is in mandatory dependencies #583

Closed
bbhtt opened this issue Dec 28, 2024 · 6 comments
Closed

[BUG] Mypy is in mandatory dependencies #583

bbhtt opened this issue Dec 28, 2024 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bbhtt
Copy link

bbhtt commented Dec 28, 2024

Describe the bug

Building 3.4.1 from PyPi sdist requires mypy to be present. #558 made this a mandatory dependency but it seems that it was only required for development purposes.

I think it should be in optional-dependencies or if you are using frameworks like poetry it should be in dev-dependencies.

To Reproduce

Try to build 3.4.1 from sdist

Expected behavior

It builds

Logs

        running egg_info
        writing src/charset_normalizer.egg-info/PKG-INFO
        writing dependency_links to src/charset_normalizer.egg-info/dependency_links.txt
        writing entry points to src/charset_normalizer.egg-info/entry_points.txt
        writing requirements to src/charset_normalizer.egg-info/requires.txt
        writing top-level names to src/charset_normalizer.egg-info/top_level.txt
        reading manifest file 'src/charset_normalizer.egg-info/SOURCES.txt'
        reading manifest template 'MANIFEST.in'
        adding license file 'LICENSE'
        writing manifest file 'src/charset_normalizer.egg-info/SOURCES.txt'
        ERROR Missing dependencies:
        	setuptools-scm
        	mypy<=1.14.0,>=1.4.1
        Command 'python -P -mbuild --no-isolation --wheel --outdir /buildstream-build/dist .' failed with exitcode 1

Desktop (please complete the following information):

  • OS: [e.g. Linux, Windows or Mac] Linux
  • Python version [e.g. 3.5] 3.13
  • Package version [eg. 2.0.0] 3.4.1

Additional context

N/A

@bbhtt bbhtt added bug Something isn't working help wanted Extra attention is needed labels Dec 28, 2024
@bbhtt
Copy link
Author

bbhtt commented Dec 28, 2024

Hm, looking at setup.py again, looks like it was an optional build dependency before for mypycify, but seems it now become mandatory, but I don't see that hooked to pyproject.toml and the build works fine when that is removed.

@Ousret
Copy link
Member

Ousret commented Dec 29, 2024

I understand how this is surprising. We decided to follow latest standards (aka. PEP) around packaging.

If you look closely you will see that the error complain about both mypy and setuptools-scm as missing.
You are correct on the assumption that mypy is "optional" yet it is required in "build" dependencies anyway. Unfortunately no concept of "groups" emerged in latest standard around build requirements. And we cannot hack our way around without complicated side effects.

Your command, python -P -mbuild --no-isolation was exactly what we wanted to avoid in order to get clean and stable builds. The faulty part in your command is --no-isolation. You should not be using it for various reasons (including security).

Hope this clarify.
If we missed something, let us know.

Regards,

@Ousret Ousret closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2024
@bbhtt
Copy link
Author

bbhtt commented Dec 29, 2024

No isolation does not matter here, forcing an optional dependency that is unused is still a bug.

Maybe you should have used something like poetry that allows to handle dev.dependencies

@Ousret
Copy link
Member

Ousret commented Dec 29, 2024

Maybe you should have used something like poetry that allows to handle dev.dependencies

It does not solve your problem. You want us to force everyone to install poetry instead, which isn't 100% compliant of latest standards.

As far I can understand, you still have the setuptools-scm issue.
If you can't accept latest PEPs, I suggest you write one and submit it. We can't do anything else about it.

regards,

@bbhtt
Copy link
Author

bbhtt commented Dec 29, 2024

You can check any python package in any distro like Arch or Fedora, --no-isolation or --no-build-isolation is used to build it against system's python modules that are specified by distro packaging recipes..

@bbhtt
Copy link
Author

bbhtt commented Dec 29, 2024

As far I can understand, you still have the setuptools-scm issue.

That was not what the bug was about, not sure why that's the topic here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Development

No branches or pull requests

2 participants