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

What is the proper way to specify min version of setuptools to handle the package. #1004

Closed
Kentzo opened this issue Mar 29, 2017 · 7 comments

Comments

@Kentzo
Copy link
Contributor

Kentzo commented Mar 29, 2017

With setuptools having releases so often it'd be nice to be able to "require" certain setuptools version in the package.

Is it currently possible via install_requires / setup_requires? Or some other option needs to be added?

@jaraco
Copy link
Member

jaraco commented Mar 29, 2017

Unfortunately no. See #1002. The solution, when available, will be PEP 518 support in pip and other installers.

@jaraco jaraco closed this as completed Mar 29, 2017
@Kentzo
Copy link
Contributor Author

Kentzo commented Nov 21, 2017

@jaraco With PEP 518 being added to pip, is it possible to specify required version now?

For setuptools-only, can this feature be backported to support setup.cfg-style configuration?

@jaraco
Copy link
Member

jaraco commented Nov 22, 2017

Although I haven't been following the pip development (and I really need to try out this functionality), I think the way it works is that in your project which requires a specific version of setuptools, you declare that in the project.toml. So if you need Setuptools 30.3 or later, you have setuptools>=30.3 in the toml file. I don't yet know the specifics, but that's the intention. Then when building/installing the package from source, it's the responsibility of pip to ensure that's satisfied before setup.py is executed. I use 30.3 as that's the first version that supported declarative config.

@jaraco
Copy link
Member

jaraco commented Nov 22, 2017

Of course, this requirement will demand that your users have this late version of pip installed or that they otherwise prepare the environment in advance to satisfy the requirements that the toml declares.

@Kentzo
Copy link
Contributor Author

Kentzo commented Nov 22, 2017

Is there a solution for a case when I install everything with setuptools, without pip?

@jaraco
Copy link
Member

jaraco commented Nov 22, 2017

You could write your own installer, but you'd essentially be replicating what's in pip. It would read the .toml file, determine the build dependencies, resolve, download, build and install them to a temporary location, and then build the target package.

It's conceivable that Setuptools could be updated to enforce a minimum version, based on some declaration in the target package, but such a feature doesn't yet exist, so would only work for future releases of Setuptools.

Do you have something else in mind?

@Kentzo
Copy link
Contributor Author

Kentzo commented Nov 22, 2017

What about a case when min version is needed for other command than install?

Perhaps future versions of setuptools should try to parse pyproject.toml to check if current version satisfies the requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants