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

Add back setup.py for editable installations #1224

Closed
wants to merge 1 commit into from
Closed

Add back setup.py for editable installations #1224

wants to merge 1 commit into from

Conversation

banesullivan
Copy link

Resolve #1223

@nschloe
Copy link
Owner

nschloe commented Nov 29, 2021

I was pretty happy to finally be able to remove setup.py when I did. Nevertheless, I am willing to merge this if there's a perspective of removing it again. What's the future replacment idea for pip install -e in absence of setup.py?

@banesullivan
Copy link
Author

banesullivan commented Nov 29, 2021

What's the future replacment idea for pip install -e in absence of setup.py?

Honestly, I have no idea. All this setup.cfg stuff is very new to me. I think meshio should have the setup.py until there is a clear cut way to do a dev install without it (googling gave no hints)

@nschloe
Copy link
Owner

nschloe commented Nov 29, 2021

I'd say you best add your setup.py locally, and I'll keep an eye out for how this is supposed to go in a setup.cfg or -- even more modern -- pyproject.toml workflow.

@nschloe
Copy link
Owner

nschloe commented Dec 17, 2021

Here's the corresponding setuptools documentation. pypa/setuptools#2816

@akaszynski
Copy link

You can have an editable install with:

[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

I'd prefer using setuptools, but it looks like filt works.

goxberry added a commit to goxberry/meshio that referenced this pull request May 9, 2022
This commit adds a 2-line (3-line, if you count the blank line)
`setup.py` script that provides the bare minimum needed to support
packaging with `setuptools`, e.g.:

```shell
python3 setup.py sdist bdist_wheel
```

This basic `setup.py` should also support editable installations,
as requested in nschloe#1223.

The basic rationale for `setuptools` packaging is for high-performance
computing sites that lag behind in software tooling. While projects
like Spack help update this tooling to permit updating sometimes
ancient toolchains, HPC site policies -- including the HPC site I
work at -- sometimes require repackaging Python packages from source
for internal approval and security auditing, as well as for portable
installation to air-gapped machines.

While I completely agree that `setup.py` is a relic -- and to that
effect, just spent a few hours adding source code and binary wheel
installations of `flit_core`, `flit`, `pep517`, and `build` to my HPC
site for approval -- it's much, much easier to point to upstream code
than it is to have to figure out that these lines must be added for
bespoke packaging, add them, look through project documentation like
`CONTRIBUTING.md`, discover through looking at pull requests and
issues on GitHub that such a pull request may not be accepted, and
then figure out how to pass that information on to security auditors
and colleagues.

If this solution is unacceptable, I welcome other suggestions,
including writing a statement to the effect of "Pull requests adding a
`setup.py` file will not be accepted to this repository" somewhere in
documentation, along with the suggested solution of adding

```python
from setuptools import setup

setup()
```

or similar to a local copy of the repository so as to avoid the sorts
of discussions seen in nschloe#1224.
@GenevieveBuckley
Copy link

I realise this is an older PR, but it's probably unnecessary now. Pip has had support for pyrpoject.toml editable installations since pip version 21.3 (2021-10-11):

Support editable installs for projects that have a pyproject.toml and use a build backend that supports PEP 660. (#8212)

@banesullivan
Copy link
Author

Thanks for the follow up @GenevieveBuckley! Indeed this is unnecessary as of now.

I finally bit the bullet and familiarized with pyproject.toml since this was opened

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

Successfully merging this pull request may close these issues.

Add developer install instructions
4 participants