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

Avoid setup.py? #956

Open
tdegeus opened this issue Apr 25, 2023 · 8 comments
Open

Avoid setup.py? #956

tdegeus opened this issue Apr 25, 2023 · 8 comments

Comments

@tdegeus
Copy link

tdegeus commented Apr 25, 2023

Is there a way to avoid having a setup.py and to have everything in a pyproject.toml?

@henryiii
Copy link
Contributor

Sure, if you use scikit-build-core. scikit-build (or even scikit-build-core in setuptools mode) can't avoid setup.py, since there doesn't seem to be a way to add third-party keyword arguments to setup() in pyproject.toml.

@henryiii
Copy link
Contributor

henryiii commented Apr 26, 2023

Both https://github.com/pybind/scikit_build_example and https://github.com/scikit-hep/cookie when using skbuild as the backend are setup.py free. :) Awkward-core has been shipping without a setup.py for a few months now.

@tdegeus
Copy link
Author

tdegeus commented Apr 27, 2023

Thanks! So simply put if I require scikit-build-options I have to use a setup.py. A secondary question is: can I avoid putting things like name in setup.py:setup if I also put it is pyproject.toml? Edit: never mind the cookiecutter answers ;)

@henryiii
Copy link
Contributor

That's a bit too simple, IMO :). scikit-build-core has lots of options in tool.scikit-build, I'd recommend looking over the readme (and there's a list of improved features, too!). The main issue is there's no equivalent of setup.py where you can do anything you want, so we've been enabling features users want one at a time. Things that are still missing are a way to have a "pure python fallback" if compilation fails and a way to customize the compilation failure message.

Though, to be fair, two more things that are still missing are selecting a different target (vs. install) and selecting the CMakeLists.txt location, which are both scikit-build options.

@Ranger-D
Copy link

Ranger-D commented Nov 2, 2023

Excuse me,I don't get the point. How can install the package if there isn't a setup.py.

@henryiii
Copy link
Contributor

henryiii commented Nov 2, 2023

You should never be invoking setup.py directly, that's been deprecated for years (See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for example). Many projects no longer have one. You should be using tools that use PEP 517 interface to build the package, like pip and build. You can install with pip or installer.

@leha-bot
Copy link

Sure, if you use scikit-build-core. scikit-build (or even scikit-build-core in setuptools mode) can't avoid setup.py, since there doesn't seem to be a way to add third-party keyword arguments to setup() in pyproject.toml.

Hello, @henryiii ,
If I correctly understood you, seems pyproject.toml already support keywords: https://github.com/xvitaly/wloc/blob/master/pyproject.toml#L21-L31 (simple project of my friend related to geoloc)

@henryiii
Copy link
Contributor

“third-party keyword arguments” means you can’t set things like setup(cmake_source_dir = “.”) in pyproject.toml.

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

5 participants
@henryiii @tdegeus @leha-bot @Ranger-D and others