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

Enable install through pyproject.toml #399

Open
matthewfeickert opened this issue Jan 31, 2019 · 11 comments
Open

Enable install through pyproject.toml #399

matthewfeickert opened this issue Jan 31, 2019 · 11 comments
Assignees
Labels
feat/enhancement New feature or request research experimental stuff

Comments

@matthewfeickert
Copy link
Member

Description

Given PEP 518 it would be nice to have the ability to install pyhf through the pyproject.toml (which already exists since PR #322) as an alternative (...or in the future a replacement) to using the setup.py with pip. This would also allow installation with dependency managers like Poetry.

@matthewfeickert matthewfeickert added feat/enhancement New feature or request research experimental stuff labels Jan 31, 2019
@matthewfeickert matthewfeickert self-assigned this Jan 31, 2019
@matthewfeickert
Copy link
Member Author

matthewfeickert commented Feb 11, 2019

Should also consider moving the bulk of setup.py to setup.cfg to take advantage of setuptools's work to support PEP 517.

c.f. Bernat Gabor's post on this

@webknjaz
Copy link
Contributor

webknjaz commented Apr 9, 2019

Just drop in a pyproject.toml like this and that's it:

[build-system]
requires = [
  "setuptools >= 41.0.0",
  "setuptools_scm >= 1.15.0",
  "setuptools_scm_git_archive >= 1.0",
  "wheel",
]
build-backend = "setuptools.build_meta"

@matthewfeickert
Copy link
Member Author

Given PR #455 this Twitter thread from @bskinn will probably be useful in the future for doing this properly.

@webknjaz
Copy link
Contributor

This mostly hit tox users (because it always uses the latest published pip): tox-dev/tox#1276. But the maintainers are quite responsive and the fix should be out soon anyway :)

@matthewfeickert
Copy link
Member Author

This mostly hit tox users

Yeah, it happened to us as well (PR #455). I've been watching the Issue, which should help in the future.

@webknjaz
Copy link
Contributor

It's not the same: tox updates pip to the latest version and the workaround to this is quite non-trivial for tox specifically :)

@bskinn
Copy link

bskinn commented Apr 28, 2019

Huh. It must be a particular style of tox usage, because my tox works fine for two different projects, using it for factorial testing of dependency matrices.

@webknjaz
Copy link
Contributor

webknjaz commented Apr 28, 2019

You'll hit the bug only if you have a combo of pyproject.toml file existing in the project + editable mode.

@webknjaz
Copy link
Contributor

The workaround, for now, is smth like this: ansible/molecule#2009

@bskinn
Copy link

bskinn commented Apr 28, 2019

Interesting... what's the use case for an editable install inside a tox environment? Post-install inspection/meddling?

@webknjaz
Copy link
Contributor

Just for development purposes. By default, tox doesn't reinstall the env. Unless you make it.
And use_develop = True is it's default setting.
This way, when you rerun tests they are executed against existing env + your source code is already linked there. Of course, this assumes you don't have something that has to be compiled every time.

@kratsg kratsg mentioned this issue Jun 26, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/enhancement New feature or request research experimental stuff
Projects
None yet
Development

No branches or pull requests

3 participants