mwouts / jupytext

Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
https://jupytext.readthedocs.io
MIT License
6.65k stars 386 forks source link

Reorganize repo to `src-layout`, migrate to `hatch` build system and `pyproject.toml` #1134

Closed mahendrapaipuri closed 1 year ago

mahendrapaipuri commented 1 year ago

This PR attempts to reorganize repo to src-layout, migrate the package to hatch build system which is being used in the Jupyter ecosystem and also address PEP621 by moving all the package metadata to pyproject.toml.

New organization:

Only important folders are listed in the tree

.
├── binder
├── demo
├── docs
├── jupyterlab
│   ├── jupyter-config
│   ├── jupyterlab_jupytext
│   └── packages
│       └── jupyterlab-jupytext-extension
│           ├── src
│           └── style
├── src
│   ├── jupytext
│   └── jupytext_config
└── tests

Breaking changes:

TLDR; Instead of distrtributing a single jupytext package (which is the current case now), we split it into three jupytext (core), jupytext_config (config) and jupyterlab_jupytext (Jupyter server and lab extension). Building of labextension is disabled by default and we can enable it using HATCH_BUILD_HOOKS_ENABLE=true env var passed at pip install .

List of changes:

Misc:

I have added check-release.yml workflow from jupyter-releaser just to check if it works with the current organisation. If you are keen to move to jupyter-releaser, the workflow would be to manually bump the versions in a PR and then use prep-release and publish-release workflows which will publish python and npm packages.

Current organization does not let us to publish npm packages from jupyter-releaser. If we move jupyterlab/package.json and its auxillary config files to the root of the top, we can build and publish npm packages from jupyter-releaser workflows as well.

Todo:

Closes #1076 Closes #1114 Closes #1115 Closes #1135

mahendrapaipuri commented 1 year ago

@LecrisUT Cheers for the review!! I will wait for @mwouts as well before making any further changes, if that is ok.

mwouts commented 1 year ago

Hi @mahendrapaipuri , @LecrisUT , I am sorry I have too little time tonight to review this in more details, I'll do more tomorrow.

Is the local build supposed to work with just python -m build? Locally it fails with this message:

OSError: Error getting the version from source `regex`: file does not exist: src/jupytext/version.py

(but the file does exist)

Thanks again for making this happen!

LecrisUT commented 1 year ago

Is the local build supposed to work with just python -m build? Locally it fails with this message:

OSError: Error getting the version from source `regex`: file does not exist: src/jupytext/version.py

Yes, that's the intended interface. Not sure what's causing the error. I can help debug this issue in the weekend if it persists.

mahendrapaipuri commented 1 year ago

Closed in favour of #1140

@mwouts @LecrisUT Lets move the discussion to #1140