-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update dev requirements #688
Changes from all commits
2d24b56
bf2f2ce
4d6eae5
2e5e575
79fef51
1c322ec
cc1ce87
92ecbf2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There were no json files in the |
||
recursive-include docs *.rst | ||
recursive-include tests *.py *.test | ||
recursive-include tests_website *.html *.py *.rst |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs talk about a Makefile, but there wasn't one in the repo. This adds one. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -67,7 +67,7 @@ Release process | |
|
||
5. Verify correctness. | ||
|
||
1. Run tests with tox:: | ||
1. Run linting, tests, and everything else with tox:: | ||
|
||
$ tox | ||
|
||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why this has to be run twice. I think it was an error. |
||
$ make vendorverify | ||
|
||
5. Run any additional tests to verify everything else works | ||
|
||
|
@@ -102,21 +101,21 @@ Release process | |
|
||
9. Generate distribution files:: | ||
|
||
$ python setup.py sdist bdist_wheel | ||
$ python -m build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want to use the build module now. https://pypi.org/project/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. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Requirements for running flake8 | ||
flake8==6.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. flake8 has dependency conflicts with other packages, so I moved it into its own environment. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding the |
||
|
||
[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 | ||
|
@@ -46,7 +55,7 @@ extras = css | |
commands = | ||
pytest {posargs:-v} | ||
|
||
[testenv:py3-tinycss2] | ||
[testenv:pypy3-tinycss2] | ||
deps = -rrequirements-dev.txt | ||
extras = css | ||
commands = | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This probably also means that devs who are using Windows and macOS can't run these environments. I'm the only dev at the moment and I'm using Linux this week, so I'm going to ignore this for now, but I'll write it up as an issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [grumble] I should fix it now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For things like vendorverify and docs, we want to run them in CI only on Linux, but when not in CI on whatever platform. I can't figure out a way to do that that doesn't involve writing a bash script or something else that's platform-dependent, so I'm going to skip it for now. |
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching it to be tox-based where tox-gh-action will run the various tox environments depending on the Python version. Now we're running all the tox environments. Previously, we were only running the basic ones and skipping the tinycss2 ones and the build-no-lang ones in CI.