Synchronize requirements files, reduce deps installation for lint (#2943)

This commit is contained in:
Oleh Prypin
2022-08-21 17:15:46 +02:00
committed by GitHub
parent edb646621c
commit 2a06ece80a
8 changed files with 46 additions and 42 deletions

View File

@@ -34,7 +34,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox coverage codecov
python -m pip install --upgrade pip tox
- name: Run tox
run: |
python -m tox --discover $(which python)
@@ -62,10 +62,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install Node dependencies
run: |
npm install -g markdownlint-cli jshint csslint
node-version: 16
- name: Check with isort
if: always()
run: python -m tox -e isort && git diff --exit-code

View File

@@ -47,7 +47,7 @@ def main(output=None):
log.addHandler(stream)
log.setLevel(logging.DEBUG)
base_cmd = ['mkdocs', 'build', '-s', '-v', '--site-dir']
base_cmd = ['mkdocs', 'build', '-s', '--site-dir']
log.debug("Building installed themes.")
for theme in sorted(MKDOCS_THEMES):

4
requirements/lint.txt Normal file
View File

@@ -0,0 +1,4 @@
black
isort
flake8
codespell

View File

@@ -1,18 +1,19 @@
babel==2.9.0
click==8.0
click==7.0
Jinja2==2.11.1
markupsafe<=2.0.1
markupsafe==2.0.1
Markdown==3.3
PyYAML==5.1
watchdog==2.0.0
mdx_gh_links==0.2
markdown-callouts==0.2
ghp-import==1.0
pyyaml_env_tag==0.1
mkdocs-redirects==1.0.1
pymdown-extensions==8.0.1
importlib_metadata==4.3
packaging==20.5
mergedeep==1.3.4
babel==2.9.0
colorama==0.4; platform_system == 'Windows'
mdx_gh_links==0.2
markdown-callouts==0.2
mkdocs-redirects==1.0.1
pymdown-extensions==8.0.1
mkdocstrings-python==0.7.1; python_version >= '3.7'

View File

@@ -1,17 +1,19 @@
babel>=2.9.0
click>=8.0
click>=7.0
Jinja2>=2.11.1
Markdown>=3.3,<3.4
PyYAML>=5.2
markupsafe>=2.0.1
Markdown>=3.3
PyYAML>=5.1
watchdog>=2.0.0
mdx_gh_links>=0.2
markdown-callouts>=0.2
ghp-import>=1.0
pyyaml_env_tag>=0.1
mkdocs-redirects>=1.0.1
pymdown-extensions>=8.0.1
importlib_metadata>=4.3
packaging>=20.5
mergedeep>=1.3.4
babel>=2.9.0
colorama>=0.4; platform_system == 'Windows'
mdx_gh_links>=0.2
markdown-callouts>=0.2
mkdocs-redirects>=1.0.1
pymdown-extensions>=8.0.1
mkdocstrings-python>=0.7.1; python_version >= '3.7'

View File

@@ -1,5 +1,2 @@
coverage
black
isort
flake8
babel>=2.9.0

View File

@@ -62,10 +62,10 @@ setup(
packages=get_packages("mkdocs"),
include_package_data=True,
install_requires=[
'click>=3.3',
'Jinja2>=2.10.2',
'click>=7.0',
'Jinja2>=2.11.1',
'Markdown>=3.2.1,<3.4',
'PyYAML>=3.10',
'PyYAML>=5.1',
'watchdog>=2.0',
'ghp-import>=1.0',
'pyyaml_env_tag>=0.1',

33
tox.ini
View File

@@ -2,7 +2,7 @@
envlist =
py36-{unittests,min-req},
py{37,38,39,310,py3}-{unittests,min-req,integration,integration-no-babel},
black, flake8, markdown-lint, linkchecker, jshint, csslint, nobabel, codespell
black, isort, flake8, markdown-lint, linkchecker, jshint, csslint, nobabel, codespell
[testenv]
passenv = LANG
@@ -18,29 +18,30 @@ commands=
py{37,38,39,310,py3}-integration: {envpython} -m mkdocs.tests.integration --output={envtmpdir}/builds
[testenv:black]
deps=-rrequirements/test.txt
deps=black
skip_install=true
commands={envbindir}/black -l100 -tpy36 --skip-string-normalization mkdocs
[testenv:isort]
deps=-rrequirements/test.txt
deps=isort
skip_install=true
commands={envbindir}/isort mkdocs
[testenv:flake8]
deps=-rrequirements/test.txt
deps=flake8
skip_install=true
commands={envbindir}/flake8 mkdocs
[testenv:markdown-lint]
whitelist_externals=
node
markdownlint
passenv = *
whitelist_externals=npm
skip_install=true
passenv=*
commands=
node --version
markdownlint --version
markdownlint README.md CONTRIBUTING.md docs/ --ignore docs/CNAME
npm exec --yes -- markdownlint-cli README.md CONTRIBUTING.md docs/ --ignore docs/CNAME
[testenv:codespell]
deps=codespell
skip_install=true
commands=
{envbindir}/codespell mkdocs docs *.* -S .tox -S LC_MESSAGES -S '*.min.js' -S 'lunr*.js' -S fontawesome-webfont.svg -S tinyseg.js
@@ -56,14 +57,16 @@ commands=
linkchecker {envtmpdir}/builds/
[testenv:jshint]
whitelist_externals = jshint
whitelist_externals=npm
skip_install=true
passenv=*
commands=jshint mkdocs/
commands=npm exec --yes -- jshint mkdocs/
[testenv:csslint]
whitelist_externals = csslint
whitelist_externals=npm
skip_install=true
passenv=*
commands=csslint mkdocs/
commands=npm exec --yes -- csslint mkdocs/
[testenv:py{37,38,39,310,py3}-integration-no-babel]
passenv = LANG