summaryrefslogtreecommitdiff
path: root/prepare-release.sh
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2023-04-07 11:08:53 -0400
committerLeonard Richardson <leonardr@segfault.org>2023-04-07 11:08:53 -0400
commite3e5ce6a2a32a915263784a55c28c9dd4e2af6e0 (patch)
tree153b7f0c823e04885b4aaea1da015d2d627fcdcd /prepare-release.sh
parent67336dd4cd781a7d27716a5bcaae939e80a7bc24 (diff)
Update release instructions for 4.12.2.
Diffstat (limited to 'prepare-release.sh')
-rw-r--r--prepare-release.sh49
1 files changed, 43 insertions, 6 deletions
diff --git a/prepare-release.sh b/prepare-release.sh
index 2f139d7..3ccb1b3 100644
--- a/prepare-release.sh
+++ b/prepare-release.sh
@@ -8,7 +8,10 @@
# release the second time, add the '--pre' argument to pip install to
# find the 'prerelease'.
-# Change the version number in
+# At some point I'll become confident enough with hatch and tox
+# that it won't be necessary to do so many install and test steps.
+
+# First, change the version number in
# CHANGELOG
# bs4/__init__.py
# doc/source/index.rst
@@ -19,11 +22,11 @@ tox run-parallel
# Build sdist and wheel.
hatch build
-# Test the wheel locally.
+# Test the sdist locally.
rm -rf ../py3-install-test-virtualenv
virtualenv -p /usr/bin/python3 ../py3-install-test-virtualenv
source ../py3-install-test-virtualenv/bin/activate
-pip install dist/beautifulsoup4-*.whl pytest lxml html5lib soupsieve
+pip install dist/beautifulsoup4-*.tar.gz pytest lxml html5lib soupsieve
python -m pytest ../py3-install-test-virtualenv/lib/python3.10/site-packages/bs4/tests/
echo "EXPECT HTML ON LINE BELOW"
(cd .. && which python && python -c "from bs4 import _s, __version__; print(__version__, _s('<a>foo', 'lxml'))")
@@ -31,24 +34,43 @@ echo "EXPECT HTML ON LINE BELOW"
# /home/.../py3-install-test-virtualenv/bin/python
# [new version number] <a>foo</a>
+
+# Test the wheel locally.
+pip uninstall beautifulsoup4
+pip install dist/beautifulsoup4-*.whl
+echo "EXPECT HTML ON LINE BELOW"
+(cd .. && which python && python -c "from bs4 import _s, __version__; print(__version__, _s('<a>foo', 'lxml'))")
+
deactivate
rm -rf ../py3-install-test-virtualenv
# Upload to test pypi
hatch publish -r test
-# Test install from test pypi
+# Test install from test pypi.
rm -rf ../py3-install-test-virtualenv
virtualenv -p /usr/bin/python3 ../py3-install-test-virtualenv
source ../py3-install-test-virtualenv/bin/activate
pip install pytest lxml html5lib
-pip install -i https://testpypi.python.org/pypi beautifulsoup4 --extra-index-url=https://pypi.python.org/pypi
+
+# First, install from source and run the tests.
+pip install -i https://testpypi.python.org/pypi beautifulsoup4 --extra-index-url=https://pypi.python.org/pypi --no-binary beautifulsoup4
python -m pytest ../py3-install-test-virtualenv/lib/python3.10/site-packages/bs4/tests/
echo "EXPECT HTML ON LINE BELOW"
(cd .. && which python && python -c "from bs4 import _s, __version__; print(__version__, _s('<a>foo', 'lxml'))")
# That should print something like:
# /home/.../py3-install-test-virtualenv/bin/python
# [new version number] <a>foo</a>
+
+# Next, install the wheel and just test functionality.
+pip uninstall beautifulsoup4
+pip install -i https://testpypi.python.org/pypi beautifulsoup4 --extra-index-url=https://pypi.python.org/pypi
+echo "EXPECT HTML ON LINE BELOW"
+(cd .. && which python && python -c "from bs4 import _s, __version__; print(__version__, _s('<a>foo', 'lxml'))")
+# That should print something like:
+# /home/.../py3-install-test-virtualenv/bin/python
+# [new version number] <a>foo</a>
+
deactivate
rm -rf ../py3-install-test-virtualenv
@@ -57,12 +79,27 @@ hatch publish
# Test install from production pypi
+# First, from the source distibution
rm -rf ../py3-install-test-virtualenv
virtualenv -p /usr/bin/python3 ../py3-install-test-virtualenv
source ../py3-install-test-virtualenv/bin/activate
+pip install pytest lxml html5lib beautifulsoup4 --no-binary beautifulsoup4
+python -m pytest ../py3-install-test-virtualenv/lib/python3.10/site-packages/bs4/tests/
+echo "EXPECT HTML ON LINE BELOW"
+(cd .. && which python && python -c "from bs4 import _s, __version__; print(__version__, _s('<a>foo', 'html.parser'))")
+# That should print something like:
+# /home/.../py3-install-test-virtualenv/bin/python
+# [new version number] <a>foo</a>
+
+# Next, from the wheel
+pip uninstall beautifulsoup4
pip install beautifulsoup4
echo "EXPECT HTML ON LINE BELOW"
(cd .. && which python && python -c "from bs4 import _s, __version__; print(__version__, _s('<a>foo', 'html.parser'))")
-# That should print '<a>foo</a>'
+# That should print something like:
+# /home/.../py3-install-test-virtualenv/bin/python
+# [new version number] <a>foo</a>
+
+# Cleanup
deactivate
rm -rf ../py3-install-test-virtualenv