Skip to content

Commit

Permalink
Merge pull request #688 from willkg/update-dev-deps
Browse files Browse the repository at this point in the history
Update dev requirements
  • Loading branch information
willkg committed Dec 9, 2022
2 parents ec62e79 + 92ecbf2 commit a0cadd9
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 130 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/lint.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.8"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
Expand All @@ -26,7 +26,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
Expand All @@ -40,6 +40,6 @@ jobs:
python -m pip install -U pip setuptools>=18.5
python -m pip install -r requirements-dev.txt
- name: Tests
- name: Run tests, linting, and everything else
shell: bash
run: ./scripts/run_tests.sh
run: tox
13 changes: 8 additions & 5 deletions MANIFEST.in
@@ -1,19 +1,22 @@
include CHANGES
include CONTRIBUTORS
include CONTRIBUTING.rst
include CODE_OF_CONDUCT.md
include SECURITY.md
include tox.ini
include CONTRIBUTING.rst
include CONTRIBUTORS
include LICENSE
include Makefile
include README.rst
include requirements-dev.txt
include requirements-flake8.txt
include SECURITY.md
include tox.ini

include docs/conf.py
include docs/Makefile
include docs/requirements.txt

include scripts/*

recursive-include bleach *.py *.json *.rst *.sh *.txt INSTALLER METADATA RECORD WHEEL LICENSE REQUESTED *.SHA256SUM
recursive-include bleach *.py *.rst *.sh *.txt INSTALLER METADATA RECORD WHEEL LICENSE REQUESTED *.SHA256SUM
recursive-include docs *.rst
recursive-include tests *.py *.test
recursive-include tests_website *.html *.py *.rst
33 changes: 33 additions & 0 deletions Makefile
@@ -0,0 +1,33 @@
DEFAULT_GOAL := help
PROJECT=bleach

.PHONY: help
help:
@echo "Available rules:"
@fgrep -h "##" Makefile | fgrep -v fgrep | sed 's/\(.*\):.*##/\1: /'

.PHONY: test
test: ## Run tests
tox

.PHONY: docs
docs: ## Build docs
tox -e py39-docs

.PHONY: lint
lint: ## Lint files
black --target-version=py37 --exclude=_vendor setup.py bleach/ tests/ tests_website/
tox -e py39-lint
tox -e py39-format-check

.PHONY: vendorverify
vendorverify: ## Verify vendored files
tox -e py39-vendorverify

.PHONY: clean
clean: ## Clean build artifacts
rm -rf build dist ${PROJECT}.egg-info .tox .pytest_cache
rm -rf docs/_build/*
rm -rf .eggs
find . -name __pycache__ | xargs rm -rf
find . -name '*.pyc' | xargs rm -rf
19 changes: 9 additions & 10 deletions docs/dev.rst
Expand Up @@ -42,10 +42,10 @@ Run::

$ tox

That'll run Bleach tests in all the supported Python environments. Note
that you need the necessary Python binaries for them all to be tested.
That'll run Bleach tests in all the supported Python environments. Note that
you need the necessary Python binaries for them all to be tested.

Tests are run as github actions for test and pull request events.
Tests are run as GitHub actions for test and pull request events.


Release process
Expand All @@ -67,7 +67,7 @@ Release process

5. Verify correctness.

1. Run tests with tox::
1. Run linting, tests, and everything else with tox::

$ tox

Expand All @@ -85,8 +85,7 @@ Release process
exit with ``/tmp/vendor-test exists. Please remove.`` and the exit
code should be zero)::

$ ./scripts/run_tests.sh vendorverify
$ ./scripts/run_tests.sh vendorverify
$ make vendorverify

5. Run any additional tests to verify everything else works

Expand All @@ -102,21 +101,21 @@ Release process

9. Generate distribution files::

$ python setup.py sdist bdist_wheel
$ python -m build

10. Sanity check the release contents and sizes::

$ ls -lh dist/* # file sizes should be similar
$ tar tvzf dist/bleach-${VERSION}.tar.gz
$ unzip -v dist/bleach-${VERSION}-py2.py3-none-any.whl

11. Upload them to PyPI::
11. Using a PyPI API token, upload dist files to PyPI::

$ twine upload dist/*
$ twine upload -r [REPO] dist/*

12. Push the new tag::

$ git push --tags official main
$ git push --tags [REMOTE] main

That will push the release to PyPI.

Expand Down
20 changes: 10 additions & 10 deletions requirements-dev.txt
@@ -1,12 +1,12 @@
-e .

black==22.3.0; implementation_name == 'cpython'
build==0.8.0
flake8==4.0.1
mypy==0.961; implementation_name =='cpython'
pip-tools==6.6.2
pytest==7.1.2
Sphinx==4.3.2
tox==3.25.0
twine==4.0.1
wheel==0.37.1
black==22.10.0; implementation_name == 'cpython'
build==0.9.0
mypy==0.991; implementation_name =='cpython'
pip-tools==6.11.0
pytest==7.2.0
Sphinx==5.3.0
tox==3.27.1
tox-gh-actions==2.11.0
twine==4.0.2
wheel==0.38.4
2 changes: 2 additions & 0 deletions requirements-flake8.txt
@@ -0,0 +1,2 @@
# Requirements for running flake8
flake8==6.0.0
41 changes: 0 additions & 41 deletions scripts/run_tests.sh

This file was deleted.

49 changes: 29 additions & 20 deletions tox.ini
Expand Up @@ -5,10 +5,19 @@ envlist =
py{37,38,39,310,311,py3}
py{37,38,39,310,311,py3}-tinycss2
py{37,38,39,310,311}-build-no-lang
docs
format-check
lint
vendorverify
py39-docs
py39-format-check
py39-lint
py39-vendorverify

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
pypy-3.8: pypy3

[testenv]
deps = -rrequirements-dev.txt
Expand Down Expand Up @@ -46,7 +55,7 @@ extras = css
commands =
pytest {posargs:-v}

[testenv:py3-tinycss2]
[testenv:pypy3-tinycss2]
deps = -rrequirements-dev.txt
extras = css
commands =
Expand Down Expand Up @@ -82,32 +91,32 @@ setenv =
commands =
python setup.py build

[testenv:lint]
basepython = python3.9
changedir = scripts
deps = -rrequirements-dev.txt
[testenv:py39-lint]
changedir = {toxinidir}
deps = -rrequirements-flake8.txt
platform = linux
commands =
./run_tests.sh lint
flake8 setup.py tests/ bleach/ tests_website/

[testenv:vendorverify]
basepython = python3.9
changedir = scripts
[testenv:py39-vendorverify]
changedir = {toxinidir}
deps = -rrequirements-dev.txt
platform = linux
commands =
./run_tests.sh vendorverify
{toxinidir}/scripts/vendor_verify.sh

[testenv:format-check]
basepython = python3.9
changedir = scripts
[testenv:py39-format-check]
changedir = {toxinidir}
deps = -rrequirements-dev.txt
platform = linux
commands =
./run_tests.sh format-check
black --target-version=py37 --check --diff --exclude=_vendor setup.py bleach/ tests/ tests_website/

[testenv:docs]
basepython = python3.9
[testenv:py39-docs]
changedir = docs
deps = -rrequirements-dev.txt
extras = css
platform = linux
commands =
sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest

0 comments on commit a0cadd9

Please sign in to comment.