deathbeds / importnb

notebook files as source
https://importnb.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
68 stars 5 forks source link

use hatchling as the build backend #129

Closed tonyfast closed 2 years ago

tonyfast commented 2 years ago

this work responds to #123 . this is the first time i've used hatch for a project and it worked pretty well. @bollwyvl requested that the lark grammar is generated at run time. it seemed like hatch was right for it for that job.

there is probably a more general implementation we could write a more general implementation[^lark]. in the meantime, we make it work using custom hatch build hooks that are implemented in the hatch_build.py file.

the rest of the work move the setup.py and setup.cfg information to the pyproject.toml convention that hatch abides strictly with. here we define hatchling as the build backend. we now require lark for our builds.

todo

tonyfast commented 2 years ago

i had to explicitly add the generated file to the build artifacts so it was included in the archives. the confusion which doing this was that most of the configurations like include/exclude DONT start with a slash like src/importnb/_version.py while the artifacts require the slash prefix /src/... to be included in the archive. should be working now

tonyfast commented 2 years ago

@bollwyvl i got some windows problems you've likely crossed before.

ofek commented 2 years ago

some windows problems

I only use Windows 🙂

For the subprocess call just pass in a list of the command parts, remove shlex and no need for shell=

ofek commented 2 years ago

nox passes for me

tonyfast commented 2 years ago

thanks so much for those fixes @ofek and working me through this pull request. i really appreciate your help.

i gotta clean up the current ci then i'll get this merged.