-
Notifications
You must be signed in to change notification settings - Fork 201
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
👌 IMPROVE: Nicer Development Experience #172
Conversation
Oh. Oh. CI improvements! |
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.
Heya I'll have a proper look later ta. But I note from a first glance that you haven't altered the pre-commit, to ensure the css is up to date with the sass. IMO This is also the way the project should be linted, not via nox
The live compiling is good though 👍 |
You might also want to add: https://github.com/pre-commit/mirrors-scss-lint |
I don't see why that would be necessary -- I've not re-added the compiled file into version control. It is still generated by compiling the SCSS file. The difference is that it's not compiled as part of the sphinx-build run, but separately (through
nox is not a linter, but being used to run the linters ( |
The other question that came to mind is using this in a conda environment, where I do all my development. There's some notes on this here: https://nox.thea.codes/en/stable/tutorial.html#testing-with-conda |
Hmm... I don't think using conda is necessary here. All the packages in our dependency tree have wheels on all major platforms and the specific case of testing this theme doesn't need any performance optimized variants of those packages IMO. |
I'd prefer we do this separately, because I already feel like I'm changing a lot of things in this one. :) |
To be clear, this will still work in a conda environment that has a Python in it. It'll create the isolated environments for each of the sessions using the conda environment's Python, in a .nox directory and the exact same commands will do the right thing. |
Yes but I think they should be in the version control, otherwise people can only use the package directly when installing from pypi (because you run the compile in the publish workflow), and for example the RTD PR builds are now broken: https://sphinx-book-theme--172.org.readthedocs.build/en/172/ |
That's something I didn't realize. :)
Oooooo. |
That should do it. :) |
aecddc6
to
dc216a7
Compare
Okay, this should be good to go. realizes he didn't mark this PR as a draft earlier Oh nvm. 😅 |
nearly there! I'll also just have a play around with using it locally before merging |
92bddc8
to
a5ecb33
Compare
Note to self: don't dev on pre-commit while also working on other projects. It can result in bad things happening. |
Unless I'm missing something; with live-build, if you update the scss, it will compile the css in |
This is brought up in sphinx-doc/sphinx-autobuild#34, but as also previously discussed, sphinx-autobuild is an "abandoned" package which is not ideal, although if/while it works thats not necessarily a problem for a dev dependency |
This is also the upstream issue: sphinx-doc/sphinx#2090 |
Looks like changing conf.py is an option, based on sphinx issue's last comment. |
This allows us to use a dedicated compiler, allowing for more flexible workflows.
This avoids creating an infinite loop where auto-watchers that look at file modification times to re-trigger a build which recreates this file.
This prevents those files from being included in the generated output folders.
Co-authored-by: Chris Sewell <[email protected]>
Co-authored-by: Chris Sewell <[email protected]>
Co-authored-by: Chris Sewell <[email protected]>
All done! Ready to go! |
Closed-reopened to retrigger CI for the failed codecov upload. |
🎉 🥳 |
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.
A few comments from me - I guess @chrisjsewell already merged but it'd be great to hear @pradyunsg 's responses nonetheless!
|
||
* Install `pre-commit` and activate it for this repository | ||
```bash | ||
nox -s tests |
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.
how does this work with arguments passed to pytest? E.g. I often do pytest -k aspecifictest
or pytest -s
so that I can start an IPython kernel from within the test.
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.
nox just calls pytest within a particular virtualenv (which it builds) that gets created in a folder in the repository folder. But you can still run pytest normally if you don't want to use nox
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.
I was wondering if I should mention it here. The form is nox -s tests-3.8 -- (pytest-args)
.
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.
Do we want to document this? If so, please file an issue referencing the above comment.
Happy to respond. :) Dinner time right now - ill try to resolve those concerns before sleeping today. |
Closes #151 in my opinion. :)
Following @choldgraf's nudge, I ended up writing the entire noxfile for this project and rewrote a part of the contributing guide to reflect what the various commands needed during development look like with nox.
Oh, and I added the
nox -s docs-live
thing, with live-reload through sphinx-autobuild as well. :)