Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit b5edfda

Browse files
authored
req: make extras protected based file name & freeze (#48)
1 parent 80da186 commit b5edfda

14 files changed

+29
-18
lines changed

Diff for: .github/workflows/ci-checks.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
actions-ref: main
2929
import-name: "lightning_graphcore"
3030
artifact-name: dist-packages-${{ github.sha }}
31-
install-flags: '"pytorch-lightning>=2.0.0"'
31+
# todo: new veersions shall have input flags whci would de-deuplictae this hidden adjustment
32+
install-flags: '"pytorch-lightning>=2.0.0, <=2.0.6"'
3233
testing-matrix: |
3334
{
3435
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
@@ -38,4 +39,4 @@ jobs:
3839
check-docs:
3940
uses: Lightning-AI/utilities/.github/workflows/check-docs.yml@main
4041
with:
41-
requirements-file: "_requirements/docs.txt"
42+
requirements-file: "requirements/_docs.txt"

Diff for: .github/workflows/ci-dockers.yml renamed to .github/workflows/docker-build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ on:
77
branches: [main, "release/*"]
88
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
99
paths:
10-
- ".github/workflows/ci-dockers.yml"
10+
- ".github/workflows/docker-build.yml"
1111
- "dockers/**"
12-
- "_requirements/*.txt"
12+
- "requirements/*.txt"
1313
- "setup.py"
1414
- "!*.md"
1515
- "!**/*.md"

Diff for: .github/workflows/docs-deploy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
uses: actions/cache@v3
2525
with:
2626
path: ~/.cache/pip
27-
key: pip-${{ hashFiles('_requirements/docs.txt') }}
27+
key: pip-${{ hashFiles('requirements/_docs.txt') }}
2828
restore-keys: pip-
2929

3030
- name: Install dependencies
3131
run: |
3232
pip --version
33-
pip install . -U -q -r _requirements/docs.txt -f ${TORCH_URL}
33+
pip install . -U -q -r requirements/_docs.txt -f ${TORCH_URL}
3434
# install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux
3535
sudo apt-get update --fix-missing
3636
sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures

Diff for: .readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ formats: all
1717
python:
1818
version: 3.7
1919
install:
20-
- requirements: _requirements/docs.txt
20+
- requirements: requirements/_docs.txt

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ export SPHINX_MOCK_REQUIREMENTS=0
77

88
test: clean
99
pip install -q -r requirements.txt
10-
pip install -q -r _requirements/test.txt
10+
pip install -q -r requirements/_test.txt
1111

1212
# use this to run tests
1313
python -m coverage run --source lightning_graphcore -m pytest src tests -v --flake8
1414
python -m coverage report
1515

1616
docs: clean
17-
pip install . --quiet -r _requirements/docs.txt
17+
pip install . --quiet -r requirements/_docs.txt
1818
python -m sphinx -b html -W --keep-going docs/source docs/build
1919

2020
clean:

Diff for: _requirements/lightning.txt

-3
This file was deleted.

Diff for: _requirements/pytorch-lightning.txt

-3
This file was deleted.

Diff for: docs/source/index.rst

+8
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ Accelerator: IPU training
5151
</div>
5252

5353

54+
.. toctree::
55+
:maxdepth: 1
56+
:name: start
57+
:caption: Start here
58+
59+
readme
60+
61+
5462
Indices and tables
5563
==================
5664

File renamed without changes.
File renamed without changes.

Diff for: requirements/lightning.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# this sets the requirements contains if you go with main lightning
2+
3+
# in 2.0.7 we have removed lightning.pytorch.overrides.base._LightningPrecisionModuleWrapperBase
4+
lightning >=2.0.0, <=2.0.6

Diff for: requirements/pytorch-lightning.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# this sets the requirements contains if you go with main lightning
2+
3+
# in 2.0.7 we have removed pytorch_lightning.overrides.base._LightningPrecisionModuleWrapperBase
4+
pytorch-lightning >=2.0.0, <=2.0.6
File renamed without changes.

Diff for: setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
_PATH_ROOT = os.path.dirname(__file__)
1111
_PATH_SOURCE = os.path.join(_PATH_ROOT, "src")
12-
_PATH_REQUIRES = os.path.join(_PATH_ROOT, "_requirements")
12+
_PATH_REQUIRES = os.path.join(_PATH_ROOT, "requirements")
1313

1414

1515
def _load_py_module(fname, pkg="lightning_graphcore"):
@@ -29,7 +29,7 @@ def _load_requirements(path_dir: str = _PATH_ROOT, file_name: str = "requirement
2929
readme = fopen.read()
3030

3131

32-
def _prepare_extras(requirements_dir: str = _PATH_REQUIRES, skip_files: tuple = ("devel.txt", "docs.txt")) -> dict:
32+
def _prepare_extras(requirements_dir: str = _PATH_REQUIRES) -> dict:
3333
# https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras
3434
# Define package extras. These are only installed if you specify them.
3535
# From remote, use like `pip install pytorch-lightning[dev, docs]`
@@ -38,7 +38,7 @@ def _prepare_extras(requirements_dir: str = _PATH_REQUIRES, skip_files: tuple =
3838
extras = {
3939
p.stem: _load_requirements(file_name=p.name, path_dir=str(p.parent))
4040
for p in req_files
41-
if p.name not in skip_files
41+
if not p.name.startswith("_")
4242
}
4343
# todo: eventually add some custom aggregations such as `develop`
4444
extras = {name: sorted(set(reqs)) for name, reqs in extras.items()}

0 commit comments

Comments
 (0)