Skip to content
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

Update the development environment #1156

Merged
merged 7 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .ci/environment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- nbformat>=5.1.2
- pyyaml
- toml
- markdown-it-py~=1.0
- markdown-it-py
- mdit-py-plugins
- pip
- pytest
Expand All @@ -25,8 +25,8 @@ dependencies:
- flake8
- autopep8
- black
- isort>=5.3.0
- pandoc==2.16.2
- isort
- pandoc>=3.0
- sphinx-gallery<0.8
- pre-commit
- gitpython
4 changes: 0 additions & 4 deletions .lgtm.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ exclude: >
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/myint/autoflake
rev: v2.2.0
rev: v2.2.1
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.0
rev: v0.1.5
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -52,6 +52,6 @@ repos:
args: ["--profile", "black"]

- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.11.0
hooks:
- id: black
19 changes: 0 additions & 19 deletions Makefile

This file was deleted.

23 changes: 13 additions & 10 deletions docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ Most of Jupytext's code is written in Python. To develop the Python part of Jupy
```
conda env create --file environment.yml # or conda env update --file ...
conda activate jupytext-dev
python -m ipykernel install --name jupytext-dev --user
pip install -e .
```

We use the [pre-commit](https://pre-commit.com) package to run pre-commit scripts like `black` and `flake8` on the code.
Install the `jupytext` package in development mode with
```
pip install '.[dev]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you are missing a editable flag here? pip install -e '.[dev]'?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes you're right! Thanks

```

We use the [pre-commit](https://pre-commit.com) package to run pre-commit scripts like `black` and `ruff` on the code.
Install it with
```
pre-commit install
Expand All @@ -37,19 +40,19 @@ Tests are executed with `pytest`. You can run them in parallel with for instance
pytest -n 5
```

Build the `jupytext` package and install it with
Some tests require a Jupyter kernel pointing to the current environment:
```
pip install -U build wheel
python -m build
pip install dist/jupytext-x.x.x-py3-none-any.whl
python -m ipykernel install --name jupytext-dev --user
```

or with
Finally, you can build the package and install it with
```
pip install .
pip install -U build wheel
python -m build
pip install dist/jupytext-x.x.x-py3-none-any.whl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why build a wheel and install it instead of directly doing a pip install .?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I am afraid it just tells that I know so little about wheels and tars etc. Before jupytext==1.16 I would use that to test the extension because the editable install would not include the extension, but from your comment it seems that I can remove that part, so I'll remove it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, ok I see. Yes, now we build the extension always, so we can directly do editable installs!

```

Finally, note that you can use `HATCH_BUILD_HOOKS_ENABLE=false` if you don't need the lab extension - the build time will be slightly shorter.
Note that you can use `HATCH_BUILD_HOOKS_ENABLE=false` if you don't need the lab extension - the build time will be slightly shorter.

## Jupytext's extension for JupyterLab

Expand Down
18 changes: 5 additions & 13 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,17 @@ dependencies:
- mdit-py-plugins
- nbconvert
- ipykernel
- jupyter_contrib_nbextensions
- pytest
- pytest-xdist
- pytest-randomly
- pytest-cov
- pre-commit
- gitpython
- pylint
- flake8==3.9.1
- black==21.4b2
- isort==5.8.0
- flake8
- black==23.11.0
- isort==5.12.0
- autopep8
- sphinx-gallery<0.8
- pip
- setuptools
- twine
- pandoc==2.16.2
# make html in docs folder
- sphinx
- tox-conda
- pip:
- sphinx_copybutton
- pandoc>=3.0
- nodejs>=20
35 changes: 0 additions & 35 deletions make.bat

This file was deleted.

Loading