-
Notifications
You must be signed in to change notification settings - Fork 66
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
migrate to Poetry #154
migrate to Poetry #154
Conversation
@danwos I wondered if I could get a few pointers about the test environment before i go down any rabbit holes... i've done the minimal work to restructure the project to use Poetry, and i'm attempting to run the testing to make sure this is working.
which complains about a missing test fixture on each test
Is there something about the way you're running tests that sets up the environment to include the |
732 file changes looks a little bit too much :) |
Haha terrifying isn't it? Looks like the restructure has double-counted the changes- once for the deletion and once for the addition of each file. I might be able to do something about that.
Of course. I wouldn't mind getting the tests passing locally as a first pass though. I don't have any concerns about getting Poetry, Tox, and Jenkins to play nicely together after that |
I often have this problem when file attributes got changed (mostly by some unknown voodoo on os level). |
that's the file renaming issue sorted. there's still 655 file "changes" but the majority of these are simply due to a small restructuring of the directory and are not actual changes. |
still seeing this issue. I strongly suspect i've got a version mismatch between sphinx and sphinx-testing that's causing issues. what versions of sphinx do you wish to support? I see that 'sphinx-testing' is deprecated on the current version of sphinx update: downgrading the sphinx version 3.2.1 -> 1.8.5 gives me the same error |
sphinx-testing is old, I know. And it is using nosetest! Not pytest. To be honest, I would like to use the official way of sphinx running its tests. Maybe we should start using the "new/current" way of writing tests for sphinx (pytest), without touching existing tests. The tox. file is running the tests with versions between >=2.2 and < 3.1. |
aha! ok, getting warmer. |
that's the tests running! ( there's two failures, that'll require a little more investigation. |
that's a minimal working tox configuration added back in. If I try to install multiple a couple of questions
|
it looks like see this discussion here - python-poetry/poetry#2920, and here - wntrblm/nox#347 this is turning out to be a much larger set of changes than I originally anticipated, though of course there are 0 actual code changes. How are we feeling about this @danwos? Have I gone a little off-script? |
I'm using tox with Poetry in another project: |
@danieleades thanks for all your effort. 👍 Linting should be part of tox and it can use its own environment (like flake8 does). An update of supported sphinx/python versions is normally done if: About poetry: I still think that there are 0 code changes needed. But for sure some configuration changes (tox, mabye travis, poetry itself). It's still okay for me to change. |
to be clear, the issue is not Poetry and Tox (this pull request is currently using poetry and tox together), the issue is running a tox build with poetry and a matrix of dependencies. I see that in your project you do not have any such dependency matrix. the issue is well captured in this thread, and there is a workaround proposed in this comment, however this doesn't work in this case because the separate dependency resolution (pip and poetry) results in multiple copies of |
that's the project updated to use nox instead of tox. Turns out to be much tidier with Poetry |
@danwos i've reworked this to stick to the old directory structure. You'll notice the 'files changed' is now a far less scary '10' I've added a short 'contributing' document with the required dependencies and a quick description of the endpoints. I chucked in a makefile for convenience. One strange thing i'm noticing- after running the tests ( |
I think this is ready for review. open questions-
|
Hi @danieleades, I tried to run the tests in your branch but get an error on a fresh checkout:
At least After installation of deps I get:
I guess there is a typo in the Makefile for test_matrix (test vs tests). I see that the Sphinx dependency is given as |
I've added a line to the contribution guide that explains that the dependencies must be installed before running the other 'tasks'.
You're right, these are resolved in the exact same way. I prefer to use the
It is an open question (listed above) how strict this pull request should be with dependency requirements. There are basically two approaches
This repo is clearly leaning towards the second option, which is the most flexible. I guess I need some input from the maintainers on the extent to which this should be done, and for which dependencies. |
I would like to keep the matrix-test coverage which we already have. Means: I see now reason why we should pinch out some of them. Also the poetry deps seems to be too restrictive for me (but I'm not a poetry expert). My philosophy for a lib is: Force as less as possible for specific dependencies version. I had a similar discussion with the maintainer of another project, where the version were pinned very strictly and therefore I couldn't use the lib. Please tell me if you have other thoughts about it. I'm open to learn :) |
@danwos that all makes sense. Ive got caret requirements in there only because it's the default. Poetry supports version ranges. I will update to include the ranges you mention. I can imagine one case where you might run into some challenges here is if your test dependencies shared a lot of transient dependencies with your non-dev dependencies. I could imagine situations where this breaks the dependency resolution. Note that this would only affect you during testing, and not at runtime. |
that's the dependencies and test matrix updated to cover the same range as the original |
This will need more work specifying the dependency versions as a function of python version. I won't get a chance to work on this further until next week, unfortunately |
No problem, I'm also not availabe this week.
But my goal is to support/check the PR finally next week and maybe implement some missing/open decisions by myself.
|
got a bit of time now.
looks like sphinx >=3.0 doesn't like python <3.6 I think the next steps are
edit: sphinx >=3.0 claims to support python 3.5+. Suspect the reason this is failing is a bit subtle. edit: in order to get these results i've had to disable one test which is failing on every configuration (and has been since before I started making modifications!). |
I'm using pyenv in my test environment to manage multiple versions of the python interpreter. Nox supports this, so there's no problems. back to the drawing board. |
last issue is resolved, and i'm correctly using each interpreter version in the test environment. no issues there. next problem- There's a couple of possibilities here
I suspect it's likely the third case. Especially when you consider that semantic versioning and dependency management in Python projects has been a complete free-for-all until relatively recently. Many packages simply didn't specify working ranges in earlier versions. This means that its very likely there are working configurations which Poetry will not accept. So what's next? either
there are really only two important variables in the dependency solving- the interpreter version and the sphinx major version
python 3.5 - no solutions i guess it's up to the maintainers how they want to proceed. Personally, I think this project is taking on an unnecessary maintenance burden by trying to support python 3.5 + 3.6. This project is a documentation generation tool, so in most realistic applications it's going to be used in a controlled environment like a virtual environment, a docker container, a continuous integration server, or some combination of the above. |
Sorry for my really late feedback and thanks for all of your investigations. But I have to test in on my own and I have to learn and understand 1-2 new tools (nox and poetry), so this may need some time. |
no problem, i totally understand. this is a big change, and seems to be having some unexpected effects on the test executions that will require investigation by someone with a more detailed knowledge of the code... I'll put it on ice for now, and we can revisit. I'm already using Poetry locally to install the dependencies for this project (I don't like installing system-wide dependencies if I can help it, and nox-poetry looks promising |
closing in favour of #216 rather than dealing with an ugly rebase, i've started fresh, with a slightly different approach. turns out most of the dependency errors i was getting here where from incompatibilities with project dependencies and 'nox' dependencies. i can solve this by stipulating that Nox is a system-wide dependency, and is not not installed in the isolated environment. |
No description provided.