maint: add test to extras_require, remove dev-requirements.txt

This commit is contained in:
Erik Sundell
2022-11-18 15:11:44 +01:00
parent 08ed8443f2
commit 1ac9c443b5
6 changed files with 73 additions and 66 deletions

View File

@@ -140,7 +140,7 @@ jobs:
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install --upgrade . -r dev-requirements.txt
pip install ".[test]"
if [ "${{ matrix.oldest_dependencies }}" != "" ]; then
# take any dependencies in requirements.txt such as tornado>=5.0

View File

@@ -1,39 +1,42 @@
# How to make a release
`jupyterhub` is a package [available on
PyPI](https://pypi.org/project/jupyterhub/) and
[conda-forge](https://conda-forge.org/).
These are instructions on how to make a release on PyPI.
The PyPI release is done automatically by CI when a tag is pushed.
`jupyterhub` is a package available on [PyPI][] and [conda-forge][].
These are instructions on how to make a release.
For you to follow along according to these instructions, you need:
## Pre-requisites
- To have push rights to the [jupyterhub GitHub
repository](https://github.com/jupyterhub/jupyterhub).
- Push rights to [jupyterhub/jupyterhub][]
- Push rights to [conda-forge/jupyterhub-feedstock][]
## Steps to make a release
1. Create a PR updating `docs/source/changelog.md` with [github-activity][] and
continue only when its merged.
```shell
pip install github-activity
github-activity --heading-level=3 jupyterhub/jupyterhub
```
1. Checkout main and make sure it is up to date.
```shell
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo
git checkout main
git fetch $ORIGIN main
git reset --hard $ORIGIN/main
git fetch origin main
git reset --hard origin/main
```
1. Make sure `docs/source/changelog.md` is up-to-date.
[github-activity][] can help with this.
1. Update the version with `tbump`.
You can see what will happen without making any changes with `tbump --dry-run ${VERSION}`
1. Update the version, make commits, and push a git tag with `tbump`.
```shell
pip install tbump
tbump --dry-run ${VERSION}
tbump ${VERSION}
```
This will tag and publish a release,
which will be finished on CI.
Following this, the [CI system][] will build and publish a release.
1. Reset the version back to dev, e.g. `2.1.0.dev` after releasing `2.0.0`
@@ -42,9 +45,11 @@ For you to follow along according to these instructions, you need:
```
1. Following the release to PyPI, an automated PR should arrive to
[conda-forge/jupyterhub-feedstock][],
check for the tests to succeed on this PR and then merge it to successfully
update the package for `conda` on the conda-forge channel.
[conda-forge/jupyterhub-feedstock][] with instructions.
[github-activity]: https://github.com/choldgraf/github-activity
[pypi]: https://pypi.org/project/jupyterhub/
[conda-forge]: https://anaconda.org/conda-forge/jupyterhub
[jupyterhub/jupyterhub]: https://github.com/jupyterhub/jupyterhub
[conda-forge/jupyterhub-feedstock]: https://github.com/conda-forge/jupyterhub-feedstock
[github-activity]: https://github.com/executablebooks/github-activity
[ci system]: https://github.com/jupyterhub/jupyterhub/actions/workflows/release.yml

View File

@@ -1,18 +0,0 @@
beautifulsoup4[html5lib]
coverage
cryptography
jsonschema
jupyterlab>=3
mock
# nbclassic provides the '/tree/' handler, which we use in tests
# it is a transitive dependency via jupyterlab,
# but depend on it directly
nbclassic
pre-commit
pytest>=3.3
pytest-asyncio>=0.17
pytest-cov
requests-mock
selenium
tbump
virtualenv

View File

@@ -94,12 +94,13 @@ When developing JupyterHub, you would need to make changes and be able to instan
conda install configurable-http-proxy yarn
4. Install the python packages required for JupyterHub development.
4. Install an editable version of JupyterHub and its requirements for
development and testing. This lets you edit JupyterHub code in a text editor
& restart the JupyterHub process to see your code changes immediately.
.. code:: bash
python3 -m pip install -r dev-requirements.txt
python3 -m pip install -r requirements.txt
python3 -m pip install --editable ".[test]"
5. Set up a database.
@@ -108,21 +109,13 @@ When developing JupyterHub, you would need to make changes and be able to instan
available via `Python <https://docs.python.org/3.5/library/sqlite3.html>`__.
See :doc:`/reference/database` for details on other supported databases.
6. Install the development version of JupyterHub. This lets you edit
JupyterHub code in a text editor & restart the JupyterHub process to
see your code changes immediately.
.. code:: bash
python3 -m pip install --editable .
7. You are now ready to start JupyterHub!
6. You are now ready to start JupyterHub!
.. code:: bash
jupyterhub
8. You can access JupyterHub from your browser at
7. You can access JupyterHub from your browser at
``http://localhost:8000`` now.
Happy developing!

View File

@@ -110,22 +110,28 @@ Make sure you have completed all the steps in :ref:`contributing/setup` successf
Code formatting and linting
===========================
JupyterHub has adopted automatic code formatting and linting.
As long as your code is valid, the pre-commit hook should take care of how it should look.
You can invoke the pre-commit hook manually at any time with:
JupyterHub automatically enforces code formatting. This means that pull requests
with changes breaking this formatting will receive a commit from pre-commit.ci
automatically.
To automatically format code locally, you can install pre-commit and register a
_git hook_ to automatically check with pre-commit before you make a commit if
the formatting is okay.
.. code:: bash
pip install pre-commit
pre-commit install --install-hooks
To run pre-commit manually you would do:
.. code:: bash
# check for changes to code not yet committed
pre-commit run
This should run any auto formatting on your code and tell you about any errors it couldn't fix automatically.
You may also install `black integration <https://github.com/psf/black#editor-integration>`_
into your text editor to format code automatically.
If you have already committed files before running pre-commit you can fix everything using:
.. code:: bash
# check for changes also in already committed code
pre-commit run --all-files
And committing the changes.
You may also install `black integration <https://github.com/psf/black#editor-integration>`_
into your text editor to format code automatically.

View File

@@ -121,6 +121,27 @@ setup_args = dict(
'Source': 'https://github.com/jupyterhub/jupyterhub/',
'Tracker': 'https://github.com/jupyterhub/jupyterhub/issues',
},
extras_require={
"test": [
"beautifulsoup4[html5lib]",
"coverage",
# cryptography is an optional dependency for jupyterhub that we test
# against by default
"cryptography",
"jsonschema",
"jupyterlab>=3",
"mock",
# nbclassic provides the '/tree/' handler that we tests against in
# the test test_nbclassic_control_panel.
"nbclassic",
"pytest>=3.3",
"pytest-asyncio>=0.17",
"pytest-cov",
"requests-mock",
"selenium",
"virtualenv",
],
}
)