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

👷♻️ Use hatch as build backend #204

Merged
merged 6 commits into from
Sep 9, 2023
Merged

Conversation

s-weigand
Copy link
Member

@s-weigand s-weigand commented Sep 8, 2023

Hatch is the new modern python build system which out of the box comes with a package-aware venv setup system (hatch shell will set up the dev env).
The package is fully configured via pyproject.toml eliminating the need for husk only setup.py and the setup.cfg which were needed for the old setuptools way of installing.
One of the main advantages of this change is that hatch by default uses .pth files for editable installs which are needed for proper static analysis and auto-completion by tools like pylance (vscode).
While there is a workaround for setuptools (pip install -e . --config-settings editable_mode=compat) that workaround is due to deprecation, so it is best to switch now.

During this refactoring of the build system, I also changed the documentation file format from reStructuredText to myst parser flavored markdown using rst2myst.
This gives us the full rst power as opt-in without needing to always deal rst.

Note:
For the development of pyglotaran AND pyglotaran-extras at the same time (side by side), one should still use a common environment (e.g. conda env) with pip install -e . instead of hatch shell. But hatch shell is a convenient way to develop against the latest stable version of pyglotaran without creating a dedicated global env.

Change summary

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)
  • 📚 Adds documentation of the feature

@s-weigand s-weigand requested a review from a team as a code owner September 8, 2023 20:52
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Binder 👈 Launch a binder notebook on branch s-weigand/pyglotaran-extras/hatch

🧹 Remove duplicate doc dependency
🧹 Use pinned requiremets for docs as well
In some shells (e.g. zsh) opening and closing square backets have a special meaning, thus actionlint throws an error (on linux only)
@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

Patch has no changes to coverable lines.

Files Changed Coverage
pyglotaran_extras/plotting/utils.py ø

📢 Thoughts on this report? Let us know!.

@s-weigand s-weigand requested a review from jsnel September 8, 2023 21:35
Copy link
Member

@jsnel jsnel left a comment

Choose a reason for hiding this comment

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

Great improvements, thanks!

@jsnel jsnel merged commit ce2747d into glotaran:main Sep 9, 2023
27 checks passed
@s-weigand s-weigand deleted the hatch branch September 9, 2023 13:36
s-weigand added a commit that referenced this pull request Sep 15, 2023
[Hatch](https://github.com/pypa/hatch) is the new modern python build system which out of the box comes with a package-aware venv setup system (`hatch shell` will set up the dev env).
The package is fully configured via `pyproject.toml` eliminating the need for husk only `setup.py` and the `setup.cfg` which were needed for the old `setuptools` way of installing.
One of the main advantages of this change is that `hatch` by default uses `.pth` files for editable installs which [are needed for proper static analysis and auto-completion by tools like pylance](https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#common-questions-and-issues)
(vscode).
While there is a [workaround for `setuptools`](https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior)
(`pip install -e . --config-settings editable_mode=compat`) that workaround is due to deprecation, so it is best to switch now.

During this refactoring of the build system the documentation file format was changed from `reStructuredText` to [myst
parser](https://myst-parser.readthedocs.io/en/latest/) flavored markdown using [`rst2myst`](https://rst-to-myst.readthedocs.io/en/latest/).
This gives us the full `rst` power as opt-in without needing to always deal `rst`.

**Note:**
For the development of `pyglotaran` **AND** `pyglotaran-extras` at the
same time (side by side), one should still use a common environment
(e.g. conda env) with `pip install -e .` instead of `hatch shell`. But
`hatch shell` is a convenient way to develop against the latest stable
version of `pyglotaran` without creating a dedicated global env.

### Change summary

- [👷 Use hatch as build
backend](f117a43)
- [🧹 Cleanup old installation
residuals](5107828)
- [📚👌 Convert docs from RST to
MD](eca6588)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants