mirror of
https://github.com/wassname/jaxtyping.git
synced 2026-08-28 12:50:23 +08:00
* Add a test for generators * Remove output annotations from decorators Also guarded torch imports for better compatibility with requirements.txt * Add flag to the main meta class to skip the typecheck * Return to the old solution * Make async tests work * Minor adjustments/fixing typos * Correct Python path for new tests * Remove some jax-dependent code * Implement equality for MetaArrays * Make all Dim variations frozen dataclasses * Shorten AbstractArray methods * Final touches * Removing get_origin use * Update tests with @jaxtyp
26 lines
602 B
Python
26 lines
602 B
Python
import subprocess
|
|
import sys
|
|
|
|
|
|
_py_path = sys.executable
|
|
|
|
|
|
def test_no_jax_dependency():
|
|
result = subprocess.run(
|
|
f"{_py_path} -c "
|
|
"'import jaxtyping; import sys; sys.exit(\"jax\" in sys.modules)'",
|
|
shell=True,
|
|
)
|
|
assert result.returncode == 0
|
|
|
|
|
|
# Meta-test: test that the above test will work. (i.e. that I haven't messed up using
|
|
# subprocess.)
|
|
def test_meta():
|
|
result = subprocess.run(
|
|
f"{_py_path} -c 'import jaxtyping; import jax; import sys; "
|
|
'sys.exit("jax" in sys.modules)\'',
|
|
shell=True,
|
|
)
|
|
assert result.returncode == 1
|