Skip to content

Commit dad448e

Browse files
committed
Revert "Bump timm from 0.6.13 to 0.9.2 (qubvel-org#768)"
This reverts commit e5d3db2.
1 parent e5d3db2 commit dad448e

File tree

12 files changed

+323
-323
lines changed

12 files changed

+323
-323
lines changed

.github/workflows/tests.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ on:
1111
branches: [ master ]
1212

1313
jobs:
14-
15-
lint:
16-
runs-on: ubuntu-latest
14+
test:
15+
runs-on: ubuntu-18.04
1716
steps:
1817
- uses: actions/checkout@v2
1918
- name: Set up Python ${{ matrix.python-version }}
@@ -24,27 +23,28 @@ jobs:
2423
run: |
2524
python -m pip install --upgrade pip
2625
pip install torch==1.9.0+cpu torchvision==0.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
27-
make install_dev
26+
pip install .[test]
27+
- name: Run Tests
28+
run: python -m pytest -s tests
2829
- name: Run Flake8
29-
run: make flake8
30-
- name: Run Black
31-
run: make black
30+
run: flake8 --config=.flake8
3231

33-
test:
32+
check_code_formatting:
33+
name: Check code formatting with Black
3434
runs-on: ubuntu-latest
35-
needs: [lint]
35+
strategy:
36+
matrix:
37+
python-version: [3.8]
3638
steps:
37-
- uses: actions/checkout@v2
38-
- name: Set up Python ${{ matrix.python-version }}
39+
- name: Checkout
40+
uses: actions/checkout@v2
41+
- name: Set up Python
3942
uses: actions/setup-python@v2
4043
with:
41-
python-version: 3.7
42-
- name: Install dependencies
43-
run: |
44-
python -m pip install --upgrade pip
45-
pip install torch==1.9.0+cpu torchvision==0.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
46-
make install_dev
47-
- name: Run Flake8
48-
run: make flake8
49-
- name: Run Tests
50-
run: make test
44+
python-version: ${{ matrix.python-version }}
45+
- name: Update pip
46+
run: python -m pip install --upgrade pip
47+
- name: Install Black
48+
run: pip install black==22.3.0
49+
- name: Run Black
50+
run: black --config=pyproject.toml --check .

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
hooks:
55
- id: black
66
args: [ --config=pyproject.toml ]
7-
- repo: https://github.com/pycqa/flake8.git
7+
- repo: https://gitlab.com/pycqa/flake8
88
rev: 4.0.1
99
hooks:
1010
- id: flake8

Makefile

-25
This file was deleted.

README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -469,22 +469,25 @@ $ pip install git+https://github.com/qubvel/segmentation_models.pytorch
469469
470470
### 🤝 Contributing
471471
472-
#### Install SMP
473-
472+
##### Install linting and formatting pre-commit hooks
474473
```bash
475-
make install_dev # create .venv, install SMP in dev mode
474+
pip install pre-commit black==22.3.0 flake8==4.0.1
475+
pre-commit install
476476
```
477477

478-
#### Run tests and code checks
479-
478+
##### Run tests
480479
```bash
481-
make all # run flake8, black, tests
480+
pytest -p no:cacheprovider
482481
```
483482

484-
#### Update table with encoders
483+
##### Run tests in docker
484+
```bash
485+
$ docker build -f docker/Dockerfile.dev -t smp:dev . && docker run --rm smp:dev pytest -p no:cacheprovider
486+
```
485487

488+
##### Generate table with encoders (in case you add a new encoder)
486489
```bash
487-
make table # generate table with encoders and print to stdout
490+
$ docker build -f docker/Dockerfile.dev -t smp:dev . && docker run --rm smp:dev python misc/generate_table.py
488491
```
489492

490493
### 📝 Citing

docs/conf.py

+29-38
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,20 @@
1818
import re
1919
import sys
2020
import datetime
21-
22-
sys.path.append("..")
21+
sys.path.append('..')
2322

2423
# -- Project information -----------------------------------------------------
2524

26-
project = "Segmentation Models"
27-
copyright = "{}, Pavel Iakubovskii".format(datetime.datetime.now().year)
28-
author = "Pavel Iakubovskii"
29-
25+
project = 'Segmentation Models'
26+
copyright = '{}, Pavel Iakubovskii'.format(datetime.datetime.now().year)
27+
author = 'Pavel Iakubovskii'
3028

3129
def get_version():
32-
sys.path.append("../segmentation_models_pytorch")
30+
sys.path.append('../segmentation_models_pytorch')
3331
from __version__ import __version__ as version
34-
3532
sys.path.pop(-1)
3633
return version
3734

38-
3935
version = get_version()
4036

4137
# -- General configuration ---------------------------------------------------
@@ -45,16 +41,16 @@ def get_version():
4541
# ones.
4642

4743
extensions = [
48-
"sphinx.ext.autodoc",
49-
"sphinx.ext.coverage",
50-
"sphinx.ext.napoleon",
51-
"sphinx.ext.viewcode",
52-
"sphinx.ext.mathjax",
53-
"autodocsumm",
44+
'sphinx.ext.autodoc',
45+
'sphinx.ext.coverage',
46+
'sphinx.ext.napoleon',
47+
'sphinx.ext.viewcode',
48+
'sphinx.ext.mathjax',
49+
'autodocsumm',
5450
]
5551

5652
# Add any paths that contain templates here, relative to this directory.
57-
templates_path = ["_templates"]
53+
templates_path = ['_templates']
5854

5955
# List of patterns, relative to source directory, that match files and
6056
# directories to ignore when looking for source files.
@@ -69,14 +65,12 @@ def get_version():
6965
#
7066

7167
import sphinx_rtd_theme
72-
7368
html_theme = "sphinx_rtd_theme"
7469
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
7570

7671
# import karma_sphinx_theme
7772
# html_theme = "karma_sphinx_theme"
7873
import faculty_sphinx_theme
79-
8074
html_theme = "faculty_sphinx_theme"
8175

8276
# import catalyst_sphinx_theme
@@ -88,7 +82,7 @@ def get_version():
8882
# Add any paths that contain custom static files (such as style sheets) here,
8983
# relative to this directory. They are copied after the builtin static files,
9084
# so a file named "default.css" will overwrite the builtin "default.css".
91-
html_static_path = ["_static"]
85+
html_static_path = ['_static']
9286

9387
# -- Extension configuration -------------------------------------------------
9488

@@ -98,40 +92,37 @@ def get_version():
9892
napoleon_numpy_docstring = False
9993

10094
autodoc_mock_imports = [
101-
"torch",
102-
"tqdm",
103-
"numpy",
104-
"timm",
105-
"cv2",
106-
"PIL",
107-
"pretrainedmodels",
108-
"torchvision",
109-
"efficientnet-pytorch",
110-
"segmentation_models_pytorch.encoders",
111-
"segmentation_models_pytorch.utils",
95+
'torch',
96+
'tqdm',
97+
'numpy',
98+
'timm',
99+
'cv2',
100+
'PIL',
101+
'pretrainedmodels',
102+
'torchvision',
103+
'efficientnet-pytorch',
104+
'segmentation_models_pytorch.encoders',
105+
'segmentation_models_pytorch.utils',
112106
# 'segmentation_models_pytorch.base',
113107
]
114108

115-
autoclass_content = "both"
116-
autodoc_typehints = "description"
109+
autoclass_content = 'both'
110+
autodoc_typehints = 'description'
117111

118112
# --- Work around to make autoclass signatures not (*args, **kwargs) ----------
119113

120-
121-
class FakeSignature:
114+
class FakeSignature():
122115
def __getattribute__(self, *args):
123116
raise ValueError
124117

125-
126118
def f(app, obj, bound_method):
127119
if "__new__" in obj.__name__:
128120
obj.__signature__ = FakeSignature()
129121

130-
131122
def setup(app):
132-
app.connect("autodoc-before-process-signature", f)
123+
app.connect('autodoc-before-process-signature', f)
133124

134125

135126
# Custom configuration --------------------------------------------------------
136127

137-
autodoc_member_order = "bysource"
128+
autodoc_member_order = 'bysource'

docs/encoders.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ EfficientNet
249249
+------------------------+--------------------------------------+-------------+
250250
| timm-efficientnet-b8 | imagenet / advprop | 84M |
251251
+------------------------+--------------------------------------+-------------+
252-
| timm-efficientnet-l2 | noisy-student / noisy-student-475 | 474M |
252+
| timm-efficientnet-l2 | noisy-student | 474M |
253253
+------------------------+--------------------------------------+-------------+
254254
| timm-efficientnet-lite0| imagenet | 4M |
255255
+------------------------+--------------------------------------+-------------+

0 commit comments

Comments
 (0)