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

Show that jupyterlite_dir is expected to be a PosixPath object in docs #106

Closed
matthewfeickert opened this issue Aug 17, 2023 · 3 comments
Closed
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@matthewfeickert
Copy link

Problem

Following scikit-hep/pyhf#2299 I noticed that jupyterlite_dir config option

jupyterlite_dir = app.env.config.jupyterlite_dir

is expected to be a PosixPath object

prefix = os.path.relpath(
os.path.join(self.env.app.srcdir, JUPYTERLITE_DIR), source_location
)

else it can raise a warning of

WARNING: The config value `jupyterlite_dir' has type `str', defaults to `PosixPath'.

However, in the docs it is show as a str:

## JupyterLite dir
By default, jupyterlite-sphinx runs the `jupyter lite build` command in the docs directory, you can overwrite this behavior and ask jupyterlite to build in a given directory:
```python
# Build in the current directory
jupyterlite_dir = "/path/to/your/lite/dir"
```

Suggested Improvement

It would be good to avoid warnings at runtime for users, so if the docs can be updated to show usage of a pathlib.Path or os.path object that would be great.

Related: scikit-hep/pyhf#2300

@matthewfeickert matthewfeickert added the documentation Improvements or additions to documentation label Aug 17, 2023
@matthewfeickert
Copy link
Author

I guess alternatively it could be converted into a path object in the code if needed, which is probably easier.

@martinRenou martinRenou added the bug Something isn't working label Aug 21, 2023
@martinRenou
Copy link
Member

Thank you for opening an issue.

I guess alternatively it could be converted into a path object in the code if needed

That sounds reasonable indeed. Would you have time for a PR? Happy to give a review

@matthewfeickert
Copy link
Author

Resolved by PR #150 as the expected value is changed in jupyterlite-sphinx v0.13.0 from PosixPath to str.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants