diff options
author | Leonard Richardson <leonardr@segfault.org> | 2021-09-07 20:17:18 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2021-09-07 20:17:18 -0400 |
commit | a4335b05b0d65d299469dcd8aa066094fc84dd8f (patch) | |
tree | cc7069260ae4d44e47050a4ca35ecf5ee825560c | |
parent | 9d68e443978afda17f59f0ff9e73af2b9b0921c2 (diff) |
Updated release instructions following the 4.10.0 release.
-rw-r--r-- | prepare-release.sh | 144 |
1 files changed, 14 insertions, 130 deletions
diff --git a/prepare-release.sh b/prepare-release.sh index a73b17f..22c6208 100644 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -10,7 +10,6 @@ # Change the version number in # CHANGELOG -# setup.py # bs4/__init__.py # doc/source/index.rst @@ -19,157 +18,42 @@ rm -rf build dist -# Run this in a Python 2 env and a Python 3 env to make both sdist and -# wheels. -python2 setup.py sdist bdist_wheel +# Make both sdist and wheels. python3 setup.py sdist bdist_wheel +# Test the wheel locally. -# Run this in Python 3 env. - -# Upload to test -twine upload --repository-url https://test.pypi.org/legacy/ dist/* - -# Upload for real -twine upload dist/* - -# How to install from test PYPI: you need to reference the real server to get the soupstrainer dependency. -pip install -i https://testpypi.python.org/pypi beautifulsoup4 --extra-index-url=https://pypi.python.org/pypi - - - -# Old instructions: - - -# Create the 2.x source distro and wheel -python setup.py sdist bdist_wheel - -# Upload the 2.x source distro and wheel to pypi test -# python setup.py register -r test -python setup.py sdist bdist_wheel upload -r test - -# Try 2.x install from pypi test -rm -rf ../py2-install-test-virtualenv -virtualenv -p /usr/bin/python2.7 ../py2-install-test-virtualenv -source ../py2-install-test-virtualenv/bin/activate -pip install --pre -i https://pypi.python.org/pypi beautifulsoup4 -echo "EXPECT HTML ON LINE BELOW" -(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html.parser'))") -# That should print '<a>foo</a>' -deactivate -rm -rf ../py2-install-test-virtualenv - -# Try 3.x source install from pypi test -rm -rf ../py3-source-install -virtualenv -p /usr/bin/python3 ../py3-source-install -source ../py3-source-install/bin/activate -pip3 install -i https://testpypi.python.org/pypi beautifulsoup4 -echo "EXPECT HTML ON LINE BELOW" -(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html.parser'))") -# That should print '<a>foo</a>' - -# Create and upload a Python 3 wheel from within a virtual environment -# that has the Python 3 version of the code. -pip install wheel -python3 setup.py bdist_wheel upload -r test - -deactivate -rm -rf ../py3-source-install - -# Make sure setup.py works on 2.x -rm -rf ../py2-install-test-virtualenv -virtualenv -p /usr/bin/python2.7 ../py2-install-test-virtualenv -source ../py2-install-test-virtualenv/bin/activate -python setup.py install -echo "EXPECT HTML ON LINE BELOW" -(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html.parser'))") -echo -# That should print '<a>foo</a>' -deactivate -rm -rf ../py2-install-test-virtualenv -echo - -# Make sure setup.py works on 3.x rm -rf ../py3-install-test-virtualenv virtualenv -p /usr/bin/python3 ../py3-install-test-virtualenv source ../py3-install-test-virtualenv/bin/activate -python setup.py install +pip install dist/beautifulsoup4-*.whl echo "EXPECT HTML ON LINE BELOW" (cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html.parser'))") # That should print '<a>foo</a>' deactivate rm -rf ../py3-install-test-virtualenv -echo -# Make sure the 2.x wheel installs properly -rm -rf ../py2-install-test-virtualenv -virtualenv -p /usr/bin/python2.7 ../py2-install-test-virtualenv -source ../py2-install-test-virtualenv/bin/activate -pip install --upgrade setuptools -pip install dist/beautifulsoup4-4.*-py2-none-any.whl -e .[html5lib] -echo "EXPECT HTML ON LINE BELOW" -(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html5lib'))") -# That should print '<html><head></head><body><a>foo</a></body></html>' -deactivate -rm -rf ../py2-install-test-virtualenv +# + +# Upload to test +twine upload --repository-url https://test.pypi.org/legacy/ dist/* + +# Test install from test pypi -echo -# Make sure the 3.x wheel installs properly rm -rf ../py3-install-test-virtualenv virtualenv -p /usr/bin/python3 ../py3-install-test-virtualenv source ../py3-install-test-virtualenv/bin/activate -pip3 install --upgrade setuptools -pip3 install dist/beautifulsoup4-4.*-py3-none-any.whl -e .[html5lib] +pip install -i https://testpypi.python.org/pypi beautifulsoup4 --extra-index-url=https://pypi.python.org/pypi echo "EXPECT HTML ON LINE BELOW" -(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html5lib'))") -# That should print '<html><head></head><body><a>foo</a></body></html>' +(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html.parser'))") +# That should print '<a>foo</a>' deactivate rm -rf ../py3-install-test-virtualenv -################ - -Do the release for real. - +# Upload for real twine upload dist/* -# Register the project and upload the source distribution and Python 2 wheel. -# python setup.py register -# python setup.py sdist bdist_wheel upload - -# Create a Python 3 environment and install Beautiful Soup -# from the source distribution that was just uploaded -#rm -rf ../py3-source-install -#virtualenv -p /usr/bin/python3 ../py3-source-install -#source ../py3-source-install/bin/activate -#pip install -i https://pypi.python.org/pypi beautifulsoup4 -#echo "EXPECT HTML ON LINE BELOW" -#(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html.parser'))") -# That should print '<a>foo</a>' - -# Create and upload a Python 3 wheel from within a virtual environment -# that has the Python 3 version of the code. -#pip install wheel -#python3 setup.py bdist_wheel upload - -# Remove the Python 3 virtual environment. -#deactivate -#rm -rf ../py3-source-install - - -################ - -To test, after release: - -rm -rf ../py2-install-test-virtualenv -virtualenv -p /usr/bin/python2.7 ../py2-install-test-virtualenv -source ../py2-install-test-virtualenv/bin/activate -pip install beautifulsoup4 -echo "EXPECT HTML ON LINE BELOW" -(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html.parser'))") -# That should print '<a>foo</a>' -deactivate -rm -rf ../py2-install-test-virtualenv - +# Test install from production pypi rm -rf ../py3-install-test-virtualenv virtualenv -p /usr/bin/python3 ../py3-install-test-virtualenv |