mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 10:04:07 +00:00
maint: add test to extras_require, remove dev-requirements.txt
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -140,7 +140,7 @@ jobs:
|
|||||||
- name: Install Python dependencies
|
- name: Install Python dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install --upgrade . -r dev-requirements.txt
|
pip install ".[test]"
|
||||||
|
|
||||||
if [ "${{ matrix.oldest_dependencies }}" != "" ]; then
|
if [ "${{ matrix.oldest_dependencies }}" != "" ]; then
|
||||||
# take any dependencies in requirements.txt such as tornado>=5.0
|
# take any dependencies in requirements.txt such as tornado>=5.0
|
||||||
|
49
RELEASE.md
49
RELEASE.md
@@ -1,39 +1,42 @@
|
|||||||
# How to make a release
|
# How to make a release
|
||||||
|
|
||||||
`jupyterhub` is a package [available on
|
`jupyterhub` is a package available on [PyPI][] and [conda-forge][].
|
||||||
PyPI](https://pypi.org/project/jupyterhub/) and
|
These are instructions on how to make a release.
|
||||||
[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.
|
|
||||||
|
|
||||||
For you to follow along according to these instructions, you need:
|
## Pre-requisites
|
||||||
|
|
||||||
- To have push rights to the [jupyterhub GitHub
|
- Push rights to [jupyterhub/jupyterhub][]
|
||||||
repository](https://github.com/jupyterhub/jupyterhub).
|
- Push rights to [conda-forge/jupyterhub-feedstock][]
|
||||||
|
|
||||||
## Steps to make a release
|
## 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.
|
1. Checkout main and make sure it is up to date.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo
|
|
||||||
git checkout main
|
git checkout main
|
||||||
git fetch $ORIGIN main
|
git fetch origin main
|
||||||
git reset --hard $ORIGIN/main
|
git reset --hard origin/main
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Make sure `docs/source/changelog.md` is up-to-date.
|
1. Update the version, make commits, and push a git tag with `tbump`.
|
||||||
[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}`
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
pip install tbump
|
||||||
|
tbump --dry-run ${VERSION}
|
||||||
|
|
||||||
tbump ${VERSION}
|
tbump ${VERSION}
|
||||||
```
|
```
|
||||||
|
|
||||||
This will tag and publish a release,
|
Following this, the [CI system][] will build and publish a release.
|
||||||
which will be finished on CI.
|
|
||||||
|
|
||||||
1. Reset the version back to dev, e.g. `2.1.0.dev` after releasing `2.0.0`
|
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
|
1. Following the release to PyPI, an automated PR should arrive to
|
||||||
[conda-forge/jupyterhub-feedstock][],
|
[conda-forge/jupyterhub-feedstock][] with instructions.
|
||||||
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.
|
|
||||||
|
|
||||||
[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
|
[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
|
||||||
|
@@ -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
|
|
@@ -94,12 +94,13 @@ When developing JupyterHub, you would need to make changes and be able to instan
|
|||||||
|
|
||||||
conda install configurable-http-proxy yarn
|
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
|
.. code:: bash
|
||||||
|
|
||||||
python3 -m pip install -r dev-requirements.txt
|
python3 -m pip install --editable ".[test]"
|
||||||
python3 -m pip install -r requirements.txt
|
|
||||||
|
|
||||||
5. Set up a database.
|
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>`__.
|
available via `Python <https://docs.python.org/3.5/library/sqlite3.html>`__.
|
||||||
See :doc:`/reference/database` for details on other supported databases.
|
See :doc:`/reference/database` for details on other supported databases.
|
||||||
|
|
||||||
6. Install the development version of JupyterHub. This lets you edit
|
6. You are now ready to start JupyterHub!
|
||||||
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!
|
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
jupyterhub
|
jupyterhub
|
||||||
|
|
||||||
8. You can access JupyterHub from your browser at
|
7. You can access JupyterHub from your browser at
|
||||||
``http://localhost:8000`` now.
|
``http://localhost:8000`` now.
|
||||||
|
|
||||||
Happy developing!
|
Happy developing!
|
||||||
|
@@ -110,22 +110,28 @@ Make sure you have completed all the steps in :ref:`contributing/setup` successf
|
|||||||
Code formatting and linting
|
Code formatting and linting
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
JupyterHub has adopted automatic code formatting and linting.
|
JupyterHub automatically enforces code formatting. This means that pull requests
|
||||||
As long as your code is valid, the pre-commit hook should take care of how it should look.
|
with changes breaking this formatting will receive a commit from pre-commit.ci
|
||||||
You can invoke the pre-commit hook manually at any time with:
|
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
|
.. 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
|
pre-commit run
|
||||||
|
|
||||||
This should run any auto formatting on your code and tell you about any errors it couldn't fix automatically.
|
# check for changes also in already committed code
|
||||||
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
|
|
||||||
|
|
||||||
pre-commit run --all-files
|
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.
|
||||||
|
21
setup.py
21
setup.py
@@ -121,6 +121,27 @@ setup_args = dict(
|
|||||||
'Source': 'https://github.com/jupyterhub/jupyterhub/',
|
'Source': 'https://github.com/jupyterhub/jupyterhub/',
|
||||||
'Tracker': 'https://github.com/jupyterhub/jupyterhub/issues',
|
'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",
|
||||||
|
],
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user