Require setuptools, mkdocs/commands/gh_deploy.py imports pkg_resources#2347
Require setuptools, mkdocs/commands/gh_deploy.py imports pkg_resources#2347hroncok wants to merge 1 commit into
Conversation
|
I'm not sure what the point of this is. At the top of that very file we import setuptools. In other words, the script won't even run without setuptools already installed. Listing it as a dependency provides no benefit. And if the thinking is that its needs for wheels, again you can't install a |
You can install mkdocs with setuptools and loose them later. Or you can use setuptools from an isolated build environment. |
Consider we already have all the transitive runtime deps installed somehow... (I don't want to dig into that: they migh require setuptools to be installed but we don't know that for sure). Installing mkdocs "normally" works without wheel installed: And even if it did not, wheel does not require setuptools: |
|
tl;dr setuptools required and installed on build time != setuptools required on runtime |
Perhaps I should have pointed out that |
This comment was marked as abuse.
This comment was marked as abuse.
|
First of all, pip does not require setuptools. But that's irrelevant. The difference this makes is that in Fedora, we build the package using setuptools, but we ship it to users potentially without it. We can certainly require setuptools on runtime downstream only, but I was following the "upstream first" principle. If you don't want this, feel free to close it, but I belive setuptools is needed on runtime and saying it explicitly is the right thing to do. |
|
in Fedora, we build the package using setuptools, but we ship it to users potentially without it. Ah, I see. You are building for a third-party package manager. I only ever install Python packages with Python tools, so I forget about this case (and get annoyed when users file bugs because they didn't use Python tools). But my view that Python tools are better for Python packages is only an opinion and the license doesn't prevent others from making packages for other systems. but I digress...
Yes, because I've never seen any Python package list setuptools as a dependency. Yet, most all of them require it for their However, we are not calling setuptools internally. We are using Perhaps we should explore using a third-party single-purpose version parsing library. For example, Version Parser was the first result that turned up in a quick search. Although, there may be other (possibly better) options available. Unfortunately, the standard lib replacement for |
There are plenty such packages. When they use setuptools/pkg_resources on runtime, they specify the dependency.
Yes! That is the difference and that is the only reason I've opened this PR.
For the sake of dependency declaration pkg_resources is (part of) setuptools.
Consider packaging. |
That's totally fine by me. That's why I demonstrated the situation here using Python tools only. |
Yes, thank you. I knew there was some package that did this, but I couldn't remember what it was. A PR which replaced the calls to |
|
This projects uses pkg_resources in multiple places (I have only found out about the others now): Plus apparently the tests mocks it as well. I came here, clicked on an pencil bottom a added an undeclared dependency to a list, because I've noticed it was missing. I am not familiar with mkdocs codebase at all. Please don't expect me to go and migrate from one library to another. If you want to do that in the future to avoid a runtime dependency on setuptools, I suggest merging this PR first and opening a tracking issue, however I don't really see the immediate benefit of doing that. Either you depend on setuptools (which as you've noted is already installed in the majority of the cases) or you depend on packaging (which isn't) and importlib_metadata on Python < 3.8 as well. |
All of those are for collecting entry_points for extension support. They should be migrated to use |
|
Thanks. |
This removes the final dependency in pkg_resources. Closes mkdocs#2347.
This removes the final dependency in pkg_resources. Closes #2347.
As per discussion on mkdocs#2347 our new babel code base should be migrated to not require setuptools and use importlib_metadata instead
No description provided.