jupyterlab / extension-cookiecutter-ts

A cookiecutter recipe for JupyterLab extensions in Typescript
BSD 3-Clause "New" or "Revised" License
179 stars 88 forks source link

`fetchVersion` only works if the extension was built #188

Closed loichuder closed 2 years ago

loichuder commented 2 years ago

Description

This is rather a request for confirmation than a bug report.

In _version.py, fetchVersion searches package.json in the current folder (that is the folder of the python sources):

https://github.com/jupyterlab/extension-cookiecutter-ts/blob/3.0/%7B%7Bcookiecutter.python_name%7D%7D/%7B%7Bcookiecutter.python_name%7D%7D/_version.py#L7

This means the version resolution works only if the extension was built (i.e. there is a labextension folder containing the package.json in the current folder).

Is this the desired behaviour ? Would it not be more robust to search directly for package.json in the extension folder (i.e. the parent folder of the python sources) ?

welcome[bot] commented 2 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

fcollonval commented 2 years ago

This means the version resolution works only if the extension was built

Yes indeed.

Is this the desired behaviour ? Would it not be more robust to search directly for package.json in the extension folder (i.e. the parent folder of the python sources) ?

Unfortunately, we can not look outside of the python package as that code may not be in the source folder.

loichuder commented 2 years ago

Unfortunately, we can not look outside of the python package as that code may not be in the source folder.

Ah indeed, I understand now. Thanks for the clarification !