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

Replace ast.Str with ast.Constant (deprecation warning raised in python 3.12) #236

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Now make your changes. Make sure to include additional tests if necessary.
Next verify the tests all pass:

```bash
pip install pytest cloudpickle
pip install -r test/requirements.txt
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
pytest
```
Expand Down
2 changes: 1 addition & 1 deletion jaxtyping/_import_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def visit_Module(self, node: ast.Module):
for i, child in enumerate(node.body):
if isinstance(child, ast.ImportFrom) and child.module == "__future__":
continue
elif isinstance(child, ast.Expr) and isinstance(child.value, ast.Str):
elif isinstance(child, ast.Expr) and isinstance(child.value, ast.Constant):
continue # module docstring
else:
node.body.insert(i, ast.Import(names=[ast.alias("jaxtyping", None)]))
Expand Down
2 changes: 1 addition & 1 deletion test/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ beartype
cloudpickle
equinox
IPython
jaxlib
jax
pytest
pytest-asyncio
tensorflow
Expand Down
Loading