sigma-py / orthopy

:triangular_ruler: Orthogonal polynomials in all shapes and sizes.
181 stars 18 forks source link

No setup.py #97

Closed zerothi closed 3 years ago

zerothi commented 4 years ago

setup.py was removed in a recent commit. However, this makes it quite cumbersome to install the package by downloading the package and doing it manually (which is what I am doing).

I.e.

  1. Download from here
  2. Extract
  3. Do python setup.py install would fail.
  4. Then I found out that you are doing: python3 -m pep517.build --source --binary .

While pep517 may have gotten traction I would hope that you would re-enable the setup.py since it is quite convenient until pep517 has stabilized (the pep517.build documentation clearly states that this is not the final placement).

If you want a minimal setup.py you could do with:

#!/usr/bin/env python
from setuptools import setup

setup(use_scm_version=True)

and then amend your setup.cfg with

setup_requires =
    setuptools >= 41.2
    setuptools_scm

The reason is that I can't figure out how to customize --prefix with the pep517 command. And this is really necessary when trying to install in non-standard locations.

Basically I cannot do:

python3 -m pep517.build --source . --prefix=<>

Do you know of any other way?

PS. This issue would also apply to quadpy ;)

nschloe commented 4 years ago

I don't think I'll go back here, it'd simply be too much work for all of my packages.

Do you know of any other way?

No idea, but you can ask on the Python forums; there must be a solution I'm sure.

zerothi commented 4 years ago

Hm... This is rather unfortunate. If I tried with a small PR, would you accept it if you could have pep517 work side-by-side with my approach above?

By the way, why did you make this transition? I have not seen any big packages doing this, simply because I think it is still in its infant stage...?

nschloe commented 4 years ago

If you ask on Python and there is no solution to your problem, I will consider it. Post the link here.

zerothi commented 4 years ago

Ok, I have searched around and found a few discussions of interest.

Let me note (for others seeing this) that the pep517 is something that is meant as a future replacement. As of today (July 2020) the project is still somewhat in its infancy and changes may still be entered, there is no lead maintainer and ideas are still discussed (via the issues page).
As such I still believe that setup.py should be supported, in one way or another, since this makes lives easier for package distributors (see discussions below). The documentation for all of this is not something easily found, and pep517 also lacks lots of documentation.

To correctly install any package, from a user perspective, one should resort to pip. This has some difficulties in that it will build in an isolated environment. My current usage of pip would be something like this:

pip install --no-cache-dir --no-deps --no-index --no-build-isolation --compile --prefix=<> .
  1. --no-cache-dir: no wheels are saved in the $HOME/.cache directory
  2. --no-deps: do not download any dependencies
  3. --no-index: do not search the web for dependencies when building
  4. --no-build-isolation: required with --no-index since now the full environment will be used if not added, then the build will happen in an isolated environment
  5. --compile: compile py files (probably default anyways)

For reference here are some links for reading: 1
2
3
4 (mainly for --no-index requiring --no-build-isolation)

@nschloe thanks for your time, you may close this if you want.