@@ -12,45 +12,64 @@ $ PYTHONPATH=$PWD/yapf python -m yapf -i -r .
1212$ PYTHONPATH=$PWD /yapf python -m yapf -i $( git diff --name-only @{upstream})
1313```
1414
15- ## Releasing a new version
15+ ## Testing and building redistributables locally
16+
17+ YAPF uses tox 3 to test against multiple python versions and to build redistributables.
1618
17- - Run tests with Python 3.7 and 3.11:
19+ Tox will opportunistically use pyenv environments when available.
20+ To configure pyenv run the following in bash:
1821
1922``` bash
20- $ python setup.py test
23+ $ xargs -t -n1 pyenv install < .python-version
2124```
2225
23- - Bump version in ` setup.py ` .
24-
25- - Build source distribution:
26+ Test against all supported Python versions that are currently installed:
27+ ``` bash
28+ $ pipx run --spec=' tox<4' tox
29+ ```
2630
31+ Build and test the sdist and wheel against your default Python environment. The redistributables will be in the ` dist ` directory.
2732``` bash
28- $ python setup.py sdist
33+ $ tox -e bdist_wheel -e sdist
2934```
3035
31- - Check that it looks OK.
32- - Install it onto a virtualenv,
33- - run tests, and
34- - run yapf as a tool.
36+ ## Releasing a new version
3537
36- - Build release:
38+ 1 . Install all expected pyenv environements
39+ ``` bash
40+ $ xargs -t -n1 pyenv install < .python-version
41+ ```
3742
38- ``` bash
39- $ python setup.py sdist bdist_wheel
40- ```
43+ 1. Run tests against Python 3.7 - 3.11 with
44+ ` ` ` bash
45+ $ pipx run --spec=' tox<4' tox
46+ ` ` `
4147
42- - Push to PyPI:
48+ 1. Bump version in ` pyproject.toml ` .
4349
44- ``` bash
45- $ twine upload dist/*
46- ```
50+ 1. Build and test redistributables
51+
52+ ` ` ` bash
53+ $ pipx run --spec=' tox<4' tox -e bdist_wheel -e sdist
54+ ` ` `
55+
56+ 1. Check that it looks OK.
57+ 1. Install it onto a virtualenv,
58+ 1. run tests, and
59+ 1. run yapf as a tool.
4760
48- - Test in a clean virtualenv that 'pip install yapf' works with the new
61+ 1. Push to PyPI:
62+
63+ ` ` ` bash
64+ $ pipx run twine upload dist/*
65+ ` ` `
66+
67+ 1. Test in a clean virtualenv that ' pip install yapf' works with the new
4968 version.
5069
51- - Commit the version bump and add tag with:
70+ 1. Commit the version bump and add tag with:
5271
53- ``` bash
54- $ git tag v$( VERSION_NUM)
55- $ git push --tags
56- ```
72+ ` ` ` bash
73+ $ git tag v$( VERSION_NUM)
74+ $ git push --tags
75+ ` ` `
0 commit comments