-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use tox for configuration and testing #3
base: main
Are you sure you want to change the base?
Conversation
|
The benefit being that |
@tkphd that, and a lot of packages (pytest, flake8, ...) are willing to look in There's a tox-conda variant, too, which is more relevant for FiPy than for this simple package. I'm not totally sold on it. It just reports pass/fail, whereas it'd be nice if it interacted with the CircleCI workflow to report, e.g., [py27 FAIL] [py3k PASS]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tox gives you a "congratulations" smiley!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't decide if the Tox invocations are useful abstractions or obfuscations, but it definitely cleans up the Circle config, and LGTM 👍
@tkphd Thanks. I'm ambivalent about it, too. I added some discussion on using tox. Do you think it's clear and/or sufficient? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the extra commentary is valuable.
Just a note that I think everything in the config files can be moved to pyproject.toml, which is superseding setup.cfg as a single place to have all configuration. It's not that important just something to be aware of. You have pytest.ini which could also go in setup.cfg. Also most of the stuff in setup.py could go in setup.cfg. Also tox.ini can probably go in setup.cfg. |
Also, I couldn't get tox working with Nix unfortunately. I was just interested if it would work. It's a Nix package, but can't create the environments it seems. |
I'm not wedded to tox. I was just going off this warning we get from the FiPy tests:
I'll have to do some reading on PEP 518 |
That's a good reason to use tox. Strange that tox is available for, but won't run on, Nix. |
Pip works with a few hacks so no reason why tox wouldn't work with same sort of workarounds. |
tox is intertwined with virtualenv. Could that be the issue? |
My comment was nothing to do with Tox really, just how the configuration for the package overall should be done.
It seems like new Python projects have the toml file rather than the cfg file now. I think it's better because it differentiates between build and run time more clearly. Currently if you install something into a new environment and it needs cython in the setup.py you need to separately install cython first. Cython is a sort of requirement that you should get if you install with |
Yes, that's the problem. It probably just requires some environment variables set correctly before entering in the Nix shell. It also messes with PYTHONPATH I think from reading about it. Unfortunately, that then messes with Nix as it (Nix) gets all its Python packages from one ginourmous PYTHONPATH. |
I'll leave those festivities to you. If |
No, that's not what I meant. Using or not using pyproject.toml is an orthogonal problem to pytest versus tox. Tox looks good. Keep using it. You can put all the Tox config in a setup.cfg or a pyproject.toml. I'm not sure what the benefit of that by itself other than having single file for config. Doing it "right" on a new project is why I mentioned the toml thing though. I was planning on moving pymks to use this. Currently it uses a setup.cfg. I actually do have the issue of having to import cython in setup.py now so I was thinking of trying the new way. In the setup.py, I hide the cython import so that it's only needed when actually building the extension. |
Sorry to carry on. The main problem with setup.py though is that you have to run python to find out about the package, which is a real issue. It was a real problem in Nix I think when dealing with Python projects which required a lot of workarounds. I think this is one of the reasons that they want to move to a full declarative standard. |
No description provided.