mirror of
https://github.com/pmeier/light-the-torch.git
synced 2024-09-08 23:29:28 +03:00
add CI job for local installations (#124)
This commit is contained in:
38
.github/workflows/install.yml
vendored
38
.github/workflows/install.yml
vendored
@@ -128,3 +128,41 @@ jobs:
|
||||
actual = CPUBackend()
|
||||
|
||||
sys.exit(actual != expected)
|
||||
|
||||
local:
|
||||
strategy:
|
||||
matrix:
|
||||
local-project-stub:
|
||||
- pep517-setuptools
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup development environment
|
||||
uses: ./.github/actions/setup-dev-env
|
||||
|
||||
- name: Collect environment information
|
||||
run: python scripts/collect_env.py
|
||||
|
||||
- name: Install local project with PyTorch dependency
|
||||
run: ltt install --editable local-project-stubs/${{ matrix.local-project-stub }}
|
||||
|
||||
- name: Check if CPU only
|
||||
shell: python
|
||||
run: |
|
||||
import sys
|
||||
import torch
|
||||
|
||||
cuda = torch.version.cuda
|
||||
print(f"cuda = {cuda}")
|
||||
|
||||
hip = torch.version.hip
|
||||
print(f"hip = {hip}")
|
||||
|
||||
sys.exit(cuda or hip)
|
||||
|
||||
@@ -252,6 +252,12 @@ def get_extra_index_urls(computation_backends, channel):
|
||||
def patch_link_collection_with_supply_chain_attack_mitigation(
|
||||
computations_backends, channel
|
||||
):
|
||||
def is_pinned(requirement):
|
||||
if requirement.req is None:
|
||||
return False
|
||||
|
||||
return requirement.is_pinned
|
||||
|
||||
@contextlib.contextmanager
|
||||
def context(input):
|
||||
with patch_link_collection(
|
||||
@@ -261,7 +267,7 @@ def patch_link_collection_with_supply_chain_attack_mitigation(
|
||||
requirement.name
|
||||
for requirement in input.root_reqs
|
||||
if requirement.user_supplied
|
||||
and not requirement.is_pinned
|
||||
and not is_pinned(requirement)
|
||||
and requirement.name in THIRD_PARTY_PACKAGES
|
||||
},
|
||||
):
|
||||
|
||||
7
local-project-stubs/pep517-setuptools/pyproject.toml
Normal file
7
local-project-stubs/pep517-setuptools/pyproject.toml
Normal file
@@ -0,0 +1,7 @@
|
||||
[build-system]
|
||||
requires = [
|
||||
"setuptools>=42",
|
||||
"setuptools_scm[toml]>=3.4",
|
||||
"wheel",
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
||||
7
local-project-stubs/pep517-setuptools/setup.cfg
Normal file
7
local-project-stubs/pep517-setuptools/setup.cfg
Normal file
@@ -0,0 +1,7 @@
|
||||
[metadata]
|
||||
name = light-the-torch-test-package
|
||||
version = 1.2.3
|
||||
|
||||
[options]
|
||||
install_requires =
|
||||
torch
|
||||
Reference in New Issue
Block a user