-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Black vs. Click fix + test, (dev)docs, etc. (#325)
* DEV/DEP: update note about black + q2 vsns * BLD: test on two additional Q2 versions And document supported versions better in the CI. * REL: update changelog * DEV/BLD: Document and catch Q2 CLI breaking thing ha -- so it doesn't impact the tests but it does impact the CLI (i shoulda documented this clearer when i first saw it), and now this will be reflected in the build. This build should now fail. * DEV: fix up dev docs re: q2 vsn * DOC: update redsea screenshot * DEP: fix black --> click --> qiime2 conflict * STY: Re-format python using black 21.12b0 Since we pinned it in this PR. Shoulda done this with the previous commit, whoops * DEV: note about dev environment * DEP: Omit Black from dev deps; update dev docs+CI I think this is one of the more painless solutions to this problem. Eesh. * REL: note black vs. click issue in chglog * DEV: update makefile (forgor) * DOC: update README & CHANGELOG re: requirements * REL: changelog tense, etc.
- Loading branch information
Showing
8 changed files
with
101 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,20 +26,24 @@ jobs: | |
|
||
- name: Install Qurro (and its pip dependencies) | ||
run: pip install -e .[dev] | ||
|
||
- name: Install Black, also (no QIIME 2 to worry about conflicts with) | ||
run: pip install "black >= 22.3.0" | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v1 | ||
|
||
- name: Install Qurro's Node.js development dependencies | ||
run: npm install -g mocha-headless-chrome nyc [email protected] jshint | ||
|
||
# Just run the tests; don't bother running stylechecking / linting, since | ||
# that's already done in the QIIME 2 CI. | ||
- name: Run tests | ||
run: | | ||
make pytest_standalone | ||
make jstest | ||
- name: Lint and stylecheck (including using Black to check Python code) | ||
run: make stylecheck | ||
|
||
# NOTE: For now, we only submit coverage reports from the QIIME 2 CI, | ||
# since the tests that that CI runs are a superset of those ran by this | ||
# "standalone" CI. (Also, Codecov wasn't merging them, which caused | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,25 @@ in this repository or email the Qurro development team | |
|
||
## Setting up a development environment | ||
|
||
We'll use a QIIME 2 environment as the basis for creating our "development | ||
environment" -- this is convenient because some of Qurro's tests rely on QIIME | ||
2 being installed. (You could also create a development environment that does | ||
not use QIIME 2, some of Qurro's tests would not be able to be run in such an | ||
environment.) | ||
|
||
1. Fork Qurro. | ||
1. Clone your fork of Qurro's source code to your computer. | ||
2. Create a development conda environment for Qurro: | ||
1. Install the latest version of QIIME 2 natively, | ||
[as you would normally](https://docs.qiime2.org/2022.2/install/native/). | ||
_You'll need to install a QIIME 2 version of at least 2020.11._ | ||
[as you would normally](https://docs.qiime2.org/2022.8/install/native/). | ||
_You'll need to install a QIIME 2 version of at least 2022.8._ | ||
2. In a terminal, navigate to the folder to which you cloned your fork of | ||
Qurro's source code above. Run `pip install -e .[dev]` inside this folder to | ||
install Qurro along with its normal and development Python dependencies. | ||
3. Install the various Node.js requirements for testing Qurro's JavaScript | ||
3. Install Black: `pip install "black >= 22.3.0"`. We don't include this in | ||
the development dependencies for reasons that are explained later in | ||
this document. | ||
4. Install the various Node.js requirements for testing Qurro's JavaScript | ||
code. This can be done by running | ||
`npm install -g mocha-headless-chrome jshint [email protected] nyc`. Note that | ||
this will install these programs globally on your system. | ||
|
@@ -53,22 +62,24 @@ generated by Qurro's Python tests, and is used to populate some of the | |
JavaScript tests. Long story short, you'll just need to run `make test` (or | ||
just `make pytest`) before running `make jstest`. | ||
|
||
### When running QIIME 2, Qurro, etc. I get `TypeError: __init__() got multiple values for argument 'obj'` | ||
### When running `qiime`, `qiime qurro`, etc. from the CLI I get `TypeError: __init__() got multiple values for argument 'obj'` | ||
|
||
This happens due to a [Click](https://click.palletsprojects.com/en/8.1.x/) | ||
This happens due to a [Click](https://click.palletsprojects.com/) | ||
version being installed that is unsupported by | ||
QIIME 2. See [this q2cli issue](https://github.com/qiime2/q2cli/issues/259) for | ||
context. This can come up in development because one of Qurro's development | ||
dependencies is | ||
[Black](https://github.com/psf/black), and later versions of Black can rely | ||
on Click 8 (and as of writing QIIME 2 doesn't seem to support Click 8 yet). | ||
|
||
If you run into this error, you can probably get around it by installing an | ||
older version of Black, although earlier versions of Click might disagree with | ||
the later versions that we use in the CI. There isn't a great solution for this | ||
yet that I know of (short of pinning Black to an earlier version and | ||
reformatting all the Python code accordingly...), but hopefully when QIIME 2 | ||
supports Click 8 the problem will vanish. | ||
dependencies (used for auto-formatting and format-checking the Python code) is | ||
[Black](https://github.com/psf/black), and later versions of Black rely | ||
on Click 8 (and versions of QIIME 2 before 2022.8 do not support Click 8). | ||
|
||
Pinning to an older version of Black causes another problem, because -- in this | ||
case -- the newer version of Click used in QIIME 2 2022.8 environments will | ||
break Black (with [this error](https://github.com/psf/black/issues/2964)). | ||
|
||
So, we get around this issue by removing Black from our development | ||
dependencies completely. If you installed a version of QIIME 2 of at least | ||
2022.8, then installing Black (in the directions above) should not cause | ||
problems (or at least it should not cause these particular problems). | ||
|
||
## Acknowledgements | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters