Skip to content

Commit 4d3ccce

Browse files
Fix the continuous integration (#1)
1 parent 7081b8d commit 4d3ccce

9 files changed

+42
-72
lines changed

.github/workflows/checks.yaml

+1-65
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
. venv/bin/activate
6363
python -m pip install -U pip setuptools wheel
6464
pip install -U -r requirements_test.txt
65-
pip install -U -r doc/requirements.txt
6665
- name: Generate pre-commit restore key
6766
id: generate-pre-commit-key
6867
run: >-
@@ -120,67 +119,4 @@ jobs:
120119
. venv/bin/activate
121120
pip install -e .
122121
pip list | grep 'astroid\|pylint'
123-
pre-commit run --hook-stage manual pylint-with-spelling --all-files
124-
125-
spelling:
126-
name: spelling tests
127-
runs-on: ubuntu-latest
128-
timeout-minutes: 5
129-
needs: prepare-base
130-
steps:
131-
- name: Check out code from GitHub
132-
uses: actions/[email protected]
133-
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
134-
id: python
135-
uses: actions/[email protected]
136-
with:
137-
python-version: ${{ env.DEFAULT_PYTHON }}
138-
check-latest: true
139-
- name: Restore Python virtual environment
140-
id: cache-venv
141-
uses: actions/[email protected]
142-
with:
143-
path: venv
144-
fail-on-cache-miss: true
145-
key:
146-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
147-
needs.prepare-base.outputs.python-key }}
148-
- name: Run spelling checks
149-
run: |
150-
. venv/bin/activate
151-
pytest tests/ -k unittest_spelling
152-
153-
documentation:
154-
name: documentation
155-
runs-on: ubuntu-latest
156-
timeout-minutes: 20
157-
needs: prepare-base
158-
steps:
159-
- name: Check out code from GitHub
160-
uses: actions/[email protected]
161-
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
162-
id: python
163-
uses: actions/[email protected]
164-
with:
165-
python-version: ${{ env.DEFAULT_PYTHON }}
166-
check-latest: true
167-
- name: Restore Python virtual environment
168-
id: cache-venv
169-
uses: actions/[email protected]
170-
with:
171-
path: venv
172-
fail-on-cache-miss: true
173-
key:
174-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
175-
needs.prepare-base.outputs.python-key }}
176-
- name: Install tox
177-
run: |
178-
pip install -U tox
179-
- name: Run checks on documentation code examples
180-
run: |
181-
tox -e test_doc
182-
- name: Check documentation build and links
183-
run: |
184-
. venv/bin/activate
185-
cd doc
186-
make html
122+
pre-commit run pylint --all-files

.github/workflows/tests.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ jobs:
7070
. venv/bin/activate
7171
pip list | grep 'astroid\|pylint'
7272
pytest --durations=10 --benchmark-disable --cov --cov-report= tests/
73-
- name: Run functional tests with minimal messages config
74-
run: |
75-
. venv/bin/activate
76-
pip list | grep 'astroid\|pylint'
77-
pytest -vv --minimal-messages-config tests/test_functional.py
7873
- name: Upload coverage artifact
7974
uses: actions/[email protected]
8075
with:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.mypy_cache
22
.ruff_cache
3+
dist
4+
*.egg-info/

pyproject.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ classifiers = [
2727
]
2828
requires-python = ">=3.8.0"
2929
dependencies = [
30-
"astroid>=3.0.0a2,<=3.1.0-dev0",
31-
"typing-extensions>=3.10.0;python_version<'3.10'",
30+
"astroid",
3231
]
3332
dynamic = ["version"]
3433

@@ -47,6 +46,10 @@ version = {attr = "pylint_tensorflow.__init__.__version__"}
4746
[tool.aliases]
4847
test = "pytest"
4948

49+
[tool.pylint]
50+
51+
disable = ["missing-docstring"]
52+
5053
[tool.ruff]
5154

5255
# ruff is less lenient than pylint and does not make any exceptions

requirements_test.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-r requirements_test_pre_commit.txt
2+
-r requirements_test_min.txt
3+
coverage~=7.2
4+
pytest-cov~=4.0
5+
pytest-profiling~=1.7
6+
pytest-xdist~=3.2
7+
# Type packages for mypy
8+
types-pkg_resources==0.1.3

requirements_test_min.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-e .[testutils,spelling]
2+
astroid
3+
typing-extensions~=4.5
4+
pytest~=7.3
5+
pytest-benchmark~=4.0
6+
pytest-timeout~=2.1

requirements_test_pre_commit.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is accurate as long as the version in pre-commit configuration
2+
# is the latest. We don't want to pin and have to upgrade all the time.
3+
pre-commit
4+
black
5+
ruff
6+
mypy
7+
pylint==3.0.0a6

setup.cfg

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Setuptools v62.6 doesn't support editable installs with just 'pyproject.toml' (PEP 660).
2+
# Keep this file until it does!
3+
4+
[metadata]
5+
# wheel doesn't yet read license_files from pyproject.toml - tools.setuptools
6+
# Keep it here until it does!
7+
license_files =
8+
LICENSE

tests/test_todo.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from pylint_tensorflow import __version__
2+
3+
4+
def test_todo():
5+
assert __version__

0 commit comments

Comments
 (0)