diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 135bee9ac..7fe703f8d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -72,7 +72,7 @@ jobs: - name: combine Python coverage files run: | - coverage combine --append ./python/featomic/.coverage ./python/featomic-torch/.coverage + coverage combine --append ./python/featomic/.coverage ./python/featomic_torch/.coverage coverage xml - name: upload to codecov.io diff --git a/.readthedocs.yml b/.readthedocs.yml index afe2224c1..70efee587 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -18,7 +18,7 @@ build: # install featomic-torch with the CPU version of PyTorch. We can not use # the `python` section below since it does not allow to specify # `--extra-index-url` - - pip install --extra-index-url https://download.pytorch.org/whl/cpu python/featomic-torch + - pip install --extra-index-url https://download.pytorch.org/whl/cpu python/featomic_torch pre_build: # Pre-build Rust code here to avoid timeout when building docs - cargo build diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f37ebc5dd..50332de9e 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -187,7 +187,7 @@ browser tox coverage combine --append \ ./.coverage \ - ./python/featomic-torch/.coverage + ./python/featomic_torch/.coverage coverage html firefox htmlcov/index.html diff --git a/docs/src/get-started/installation.rst b/docs/src/get-started/installation.rst index f4c905fe8..910953c70 100644 --- a/docs/src/get-started/installation.rst +++ b/docs/src/get-started/installation.rst @@ -106,14 +106,14 @@ Building from source: .. code-block:: bash git clone https://github.com/metatensor/featomic - cd featomic/python/featomic-torch + cd featomic/python/featomic_torch pip install . # Make sure you are using the latest version of pip pip install --upgrade pip # alternatively, the same thing in a single command - pip install git+https://github.com/metatensor/featomic#subdirectory=python/featomic-torch + pip install git+https://github.com/metatensor/featomic#subdirectory=python/featomic_torch For usage from C++ diff --git a/python/featomic/setup.py b/python/featomic/setup.py index 97da2c5cf..fb079281a 100644 --- a/python/featomic/setup.py +++ b/python/featomic/setup.py @@ -22,8 +22,9 @@ "expected 'debug' or 'release'" ) - -FEATOMIC_TORCH_SRC = os.path.join(ROOT, "..", "featomic-torch") +# The code for featomic-torch needs to live in `featomic_torch` directory until +# https://github.com/pypa/pip/issues/13093 is fixed. +FEATOMIC_TORCH_SRC = os.path.realpath(os.path.join(ROOT, "..", "featomic_torch")) class universal_wheel(bdist_wheel): diff --git a/python/featomic-torch/AUTHORS b/python/featomic_torch/AUTHORS similarity index 100% rename from python/featomic-torch/AUTHORS rename to python/featomic_torch/AUTHORS diff --git a/python/featomic-torch/LICENSE b/python/featomic_torch/LICENSE similarity index 100% rename from python/featomic-torch/LICENSE rename to python/featomic_torch/LICENSE diff --git a/python/featomic-torch/MANIFEST.in b/python/featomic_torch/MANIFEST.in similarity index 100% rename from python/featomic-torch/MANIFEST.in rename to python/featomic_torch/MANIFEST.in diff --git a/python/featomic-torch/README.rst b/python/featomic_torch/README.rst similarity index 100% rename from python/featomic-torch/README.rst rename to python/featomic_torch/README.rst diff --git a/python/featomic-torch/build-backend/backend.py b/python/featomic_torch/build-backend/backend.py similarity index 100% rename from python/featomic-torch/build-backend/backend.py rename to python/featomic_torch/build-backend/backend.py diff --git a/python/featomic-torch/featomic/torch/__init__.py b/python/featomic_torch/featomic/torch/__init__.py similarity index 100% rename from python/featomic-torch/featomic/torch/__init__.py rename to python/featomic_torch/featomic/torch/__init__.py diff --git a/python/featomic-torch/featomic/torch/_c_lib.py b/python/featomic_torch/featomic/torch/_c_lib.py similarity index 100% rename from python/featomic-torch/featomic/torch/_c_lib.py rename to python/featomic_torch/featomic/torch/_c_lib.py diff --git a/python/featomic-torch/featomic/torch/calculator_base.py b/python/featomic_torch/featomic/torch/calculator_base.py similarity index 100% rename from python/featomic-torch/featomic/torch/calculator_base.py rename to python/featomic_torch/featomic/torch/calculator_base.py diff --git a/python/featomic-torch/featomic/torch/calculators.py b/python/featomic_torch/featomic/torch/calculators.py similarity index 100% rename from python/featomic-torch/featomic/torch/calculators.py rename to python/featomic_torch/featomic/torch/calculators.py diff --git a/python/featomic-torch/featomic/torch/clebsch_gordan.py b/python/featomic_torch/featomic/torch/clebsch_gordan.py similarity index 100% rename from python/featomic-torch/featomic/torch/clebsch_gordan.py rename to python/featomic_torch/featomic/torch/clebsch_gordan.py diff --git a/python/featomic-torch/featomic/torch/system.py b/python/featomic_torch/featomic/torch/system.py similarity index 100% rename from python/featomic-torch/featomic/torch/system.py rename to python/featomic_torch/featomic/torch/system.py diff --git a/python/featomic-torch/featomic/torch/utils.py b/python/featomic_torch/featomic/torch/utils.py similarity index 100% rename from python/featomic-torch/featomic/torch/utils.py rename to python/featomic_torch/featomic/torch/utils.py diff --git a/python/featomic-torch/pyproject.toml b/python/featomic_torch/pyproject.toml similarity index 100% rename from python/featomic-torch/pyproject.toml rename to python/featomic_torch/pyproject.toml diff --git a/python/featomic-torch/setup.py b/python/featomic_torch/setup.py similarity index 100% rename from python/featomic-torch/setup.py rename to python/featomic_torch/setup.py diff --git a/python/featomic-torch/tests/autograd.py b/python/featomic_torch/tests/autograd.py similarity index 100% rename from python/featomic-torch/tests/autograd.py rename to python/featomic_torch/tests/autograd.py diff --git a/python/featomic-torch/tests/calculator.py b/python/featomic_torch/tests/calculator.py similarity index 100% rename from python/featomic-torch/tests/calculator.py rename to python/featomic_torch/tests/calculator.py diff --git a/python/featomic-torch/tests/clebsch_gordan/cartesian_spherical.py b/python/featomic_torch/tests/clebsch_gordan/cartesian_spherical.py similarity index 100% rename from python/featomic-torch/tests/clebsch_gordan/cartesian_spherical.py rename to python/featomic_torch/tests/clebsch_gordan/cartesian_spherical.py diff --git a/python/featomic-torch/tests/clebsch_gordan/cg_product.py b/python/featomic_torch/tests/clebsch_gordan/cg_product.py similarity index 100% rename from python/featomic-torch/tests/clebsch_gordan/cg_product.py rename to python/featomic_torch/tests/clebsch_gordan/cg_product.py diff --git a/python/featomic-torch/tests/clebsch_gordan/density_correlations.py b/python/featomic_torch/tests/clebsch_gordan/density_correlations.py similarity index 100% rename from python/featomic-torch/tests/clebsch_gordan/density_correlations.py rename to python/featomic_torch/tests/clebsch_gordan/density_correlations.py diff --git a/python/featomic-torch/tests/clebsch_gordan/power_spectrum.py b/python/featomic_torch/tests/clebsch_gordan/power_spectrum.py similarity index 100% rename from python/featomic-torch/tests/clebsch_gordan/power_spectrum.py rename to python/featomic_torch/tests/clebsch_gordan/power_spectrum.py diff --git a/python/featomic-torch/tests/export.py b/python/featomic_torch/tests/export.py similarity index 100% rename from python/featomic-torch/tests/export.py rename to python/featomic_torch/tests/export.py diff --git a/python/featomic-torch/tests/system.py b/python/featomic_torch/tests/system.py similarity index 100% rename from python/featomic-torch/tests/system.py rename to python/featomic_torch/tests/system.py diff --git a/python/featomic-torch/tests/utils.py b/python/featomic_torch/tests/utils.py similarity index 100% rename from python/featomic-torch/tests/utils.py rename to python/featomic_torch/tests/utils.py diff --git a/scripts/build-all-wheels.sh b/scripts/build-all-wheels.sh index a0fec589f..b7b3faffb 100644 --- a/scripts/build-all-wheels.sh +++ b/scripts/build-all-wheels.sh @@ -42,4 +42,4 @@ export FEATOMIC_TORCH_BUILD_WITH_FEATOMIC_VERSION="$FEATOMIC_VERSION" # build featomic-torch, using featomic from `PIP_EXTRA_INDEX_URL` # for the sdist => wheel build. -python -m build python/featomic-torch --outdir "$TMP_DIR/dist" +python -m build python/featomic_torch --outdir "$TMP_DIR/dist" diff --git a/scripts/clean-python.sh b/scripts/clean-python.sh index b23cd475a..fdf33c007 100755 --- a/scripts/clean-python.sh +++ b/scripts/clean-python.sh @@ -18,9 +18,9 @@ rm -rf python/featomic/dist rm -rf python/featomic/build rm -rf python/featomic/featomic-cxx-*.tar.gz -rm -rf python/featomic-torch/dist -rm -rf python/featomic-torch/build -rm -rf python/featomic-torch/featomic-torch-cxx-*.tar.gz +rm -rf python/featomic_torch/dist +rm -rf python/featomic_torch/build +rm -rf python/featomic_torch/featomic-torch-cxx-*.tar.gz find . -name "*.egg-info" -exec rm -rf "{}" + find . -name "__pycache__" -exec rm -rf "{}" + diff --git a/scripts/package-featomic-torch.sh b/scripts/package-featomic-torch.sh index bfe44339f..85e543075 100755 --- a/scripts/package-featomic-torch.sh +++ b/scripts/package-featomic-torch.sh @@ -27,5 +27,5 @@ tar cf "$ARCHIVE_NAME".tar "$ARCHIVE_NAME" gzip -9 "$ARCHIVE_NAME".tar -rm -f "$ROOT_DIR"/python/featomic-torch/featomic-torch-cxx-*.tar.gz +rm -f "$ROOT_DIR"/python/featomic_torch/featomic-torch-cxx-*.tar.gz cp "$ARCHIVE_NAME".tar.gz "$OUTPUT_DIR/" diff --git a/tox.ini b/tox.ini index 07e5fa3a3..34cd1ccc0 100644 --- a/tox.ini +++ b/tox.ini @@ -106,7 +106,7 @@ deps = torch ase -changedir = python/featomic-torch +changedir = python/featomic_torch commands = # install featomic-torch pip install . {[testenv]build-single-wheel} --force-reinstall @@ -124,7 +124,7 @@ allowlist_externals = commands = # install featomic-torch - pip install python/featomic-torch --no-deps --no-build-isolation --force-reinstall + pip install python/featomic_torch --no-deps --no-build-isolation --force-reinstall sphinx-build {posargs:-E} -W -b html docs/src docs/build/html @@ -182,7 +182,7 @@ commands = # check building wheels directly from the a checkout python -m build python/featomic --wheel --outdir {envtmpdir}/dist - python -m build python/featomic-torch --wheel --outdir {envtmpdir}/dist + python -m build python/featomic_torch --wheel --outdir {envtmpdir}/dist [flake8] @@ -202,5 +202,5 @@ featomic = .tox/*/lib/python*/site-packages/featomic featomic_torch = - python/featomic-torch/featomic/torch + python/featomic_torch/featomic/torch .tox/*/lib/python*/site-packages/featomic/torch