summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS.txt2
-rw-r--r--NEWS.txt6
-rw-r--r--bs4/__init__.py2
-rw-r--r--bs4/element.py2
-rw-r--r--bs4/tests/test_tree.py2
-rw-r--r--prepare-release.sh66
6 files changed, 50 insertions, 30 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt
index 2ac8fcc..ea6f785 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -16,7 +16,7 @@ support CSS selectors.
Sam Ruby helped with a lot of edge cases.
-Jonathan Ellis was awarded the prestigous Beau Potage D'Or for his
+Jonathan Ellis was awarded the prestigious Beau Potage D'Or for his
work in solving the nestable tags conundrum.
An incomplete list of people have contributed patches to Beautiful
diff --git a/NEWS.txt b/NEWS.txt
index d064a40..184a56e 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -508,7 +508,7 @@ Bug fixes:
* Renamed Tag.nsprefix to Tag.prefix, for consistency with
NamespacedAttribute.
-* Fixed a test failure that occured on Python 3.x when chardet was
+* Fixed a test failure that occurred on Python 3.x when chardet was
installed.
* Made prettify() return Unicode by default, so it will look nice on
@@ -542,7 +542,7 @@ Bug fixes:
* Restored compatibility with Python 2.6.
-* The install process no longer installs docs or auxillary text files.
+* The install process no longer installs docs or auxiliary text files.
* It's now possible to deepcopy a BeautifulSoup object created with
Python's built-in HTML parser.
@@ -781,7 +781,7 @@ Added an import that makes BS work in Python 2.3.
Fixed a UnicodeDecodeError when unpickling documents that contain
non-ASCII characters.
-Fixed a TypeError that occured in some circumstances when a tag
+Fixed a TypeError that occurred in some circumstances when a tag
contained no text.
Jump through hoops to avoid the use of chardet, which can be extremely
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 308428a..6eb3b04 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -448,7 +448,7 @@ class BeautifulSoup(Tag):
"""Push a start tag on to the stack.
If this method returns None, the tag was rejected by the
- SoupStrainer. You should proceed as if the tag had not occured
+ SoupStrainer. You should proceed as if the tag had not occurred
in the document. For instance, if this was a self-closing tag,
don't call handle_endtag.
"""
diff --git a/bs4/element.py b/bs4/element.py
index 5a3665e..b100d18 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -649,7 +649,7 @@ class PageElement(object):
return lambda el: el._attr_value_as_string(
attribute, '').startswith(value)
elif operator == '$':
- # string represenation of `attribute` ends with `value`
+ # string representation of `attribute` ends with `value`
return lambda el: el._attr_value_as_string(
attribute, '').endswith(value)
elif operator == '*':
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index 984b527..a4fe0b1 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -346,7 +346,7 @@ class TestFindAllByAttribute(TreeTest):
strainer = SoupStrainer(attrs={'id' : 'first'})
self.assertSelects(tree.find_all(strainer), ['Match.'])
- def test_find_all_with_missing_atribute(self):
+ def test_find_all_with_missing_attribute(self):
# You can pass in None as the value of an attribute to find_all.
# This will match tags that do not have that attribute set.
tree = self.soup("""<a id="1">ID present.</a>
diff --git a/prepare-release.sh b/prepare-release.sh
index a30bd00..aaa95a5 100644
--- a/prepare-release.sh
+++ b/prepare-release.sh
@@ -11,52 +11,42 @@
# Make sure tests pass
./test-all-versions
-# Make sure nothing broke on 2.6
-#source ../virtualenv-2.6/bin/activate
-#nosetests
-#deactivate
-
-rm -rf dist
+rm -rf build dist
# Create the 2.x source distro and wheel
python setup.py sdist bdist_wheel
-# Create the 3.x wheel
-source ../virtualenv-3/bin/activate
-python setup.py bdist_wheel
-deactivate
-
-# Upload to pypi test
+# 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
-source ../virtualenv-3/bin/activate
-python setup.py bdist_wheel upload -r test
-deactivate
-
# 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 -i https://testpypi.python.org/pypi beautifulsoup4
+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 install from pypi test
-rm -rf ../py3-install-test-virtualenv
-virtualenv -p /usr/bin/python3 ../py3-install-test-virtualenv
-source ../py3-install-test-virtualenv/bin/activate
+# 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
pip 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>'
-deactivate
-rm -rf ../py3-install-test-virtualenv
+# 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
@@ -86,6 +76,7 @@ echo
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'))")
@@ -98,6 +89,7 @@ echo
rm -rf ../py3-install-test-virtualenv
virtualenv -p /usr/bin/python3 ../py3-install-test-virtualenv
source ../py3-install-test-virtualenv/bin/activate
+pip install --upgrade setuptools
pip install dist/beautifulsoup4-4.*-py3-none-any.whl -e .[html5lib]
echo "EXPECT HTML ON LINE BELOW"
(cd .. && python -c "from bs4 import _s; print(_s('<a>foo', 'html5lib'))")
@@ -107,6 +99,34 @@ rm -rf ../py3-install-test-virtualenv
################
+Do the release for real.
+
+# Register the project and upload the source distribution and Python 2 wheel.
+python setup.py register -r test
+python setup.py sdist bdist_wheel upload -r test
+
+# 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 -r test
+
+# Remove the Python 3 virtual environment.
+deactivate
+rm -rf ../py3-source-install
+
+
+################
+
To test, after release:
rm -rf ../py2-install-test-virtualenv