Skip to content

Commit

Permalink
Workaround for pypa/pip#13093
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Dec 4, 2024
1 parent 4968429 commit 3e4b1ce
Show file tree
Hide file tree
Showing 32 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ browser
tox
coverage combine --append \
./.coverage \
./python/featomic-torch/.coverage
./python/featomic_torch/.coverage
coverage html
firefox htmlcov/index.html
Expand Down
4 changes: 2 additions & 2 deletions docs/src/get-started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
5 changes: 3 additions & 2 deletions python/featomic/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/build-all-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions scripts/clean-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "{}" +
Expand Down
2 changes: 1 addition & 1 deletion scripts/package-featomic-torch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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]
Expand All @@ -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

0 comments on commit 3e4b1ce

Please sign in to comment.