summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS.txt12
-rw-r--r--bs4/__init__.py2
-rw-r--r--prepare-release.sh70
-rw-r--r--setup.py59
4 files changed, 113 insertions, 30 deletions
diff --git a/NEWS.txt b/NEWS.txt
index 47d4942..bd5536a 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,7 +1,17 @@
-= 4.4.0 (Unreleased) =
+= 4.4.0 (20150703) =
Especially important changes:
+* Currently lxml is a mandatory dependency of Beautiful Soup when
+ installed via pip. In the near future, lxml will become an optional
+ dependency. Requiring lxml makes it more difficult to install
+ Beautiful Soup, and recent improvements to Python's built-in HTML
+ parser make it good enough to serve as the default.
+
+ If you install Beautiful Soup via a requirements.txt file and you
+ still want Beautiful Soup to use lxml as its parser (you probably
+ do), you should add 'lxml' to the list of requirements.
+
* Added a warning when you instantiate a BeautifulSoup object without
explicitly naming a parser. [bug=1398866]
diff --git a/bs4/__init__.py b/bs4/__init__.py
index b861d87..d35f765 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -17,7 +17,7 @@ http://www.crummy.com/software/BeautifulSoup/bs4/doc/
"""
__author__ = "Leonard Richardson (leonardr@segfault.org)"
-__version__ = "4.3.9b1"
+__version__ = "4.4.0"
__copyright__ = "Copyright (c) 2004-2015 Leonard Richardson"
__license__ = "MIT"
diff --git a/prepare-release.sh b/prepare-release.sh
new file mode 100644
index 0000000..864c5cf
--- /dev/null
+++ b/prepare-release.sh
@@ -0,0 +1,70 @@
+# A script to automatically create and test source and wheel
+# distributions of Beautiful Soup.
+
+# Recommend you run these steps one at a time rather than just running
+# the script.
+
+# 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
+
+# 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
+
+# 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'))")
+# 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
+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 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
+
+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
+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'))")
+# That should print '<html><head></head><body><a>foo</a></body></html>'
+deactivate
+rm -rf ../py3-install-test-virtualenv
diff --git a/setup.py b/setup.py
index cc6f7ea..add9ab8 100644
--- a/setup.py
+++ b/setup.py
@@ -1,30 +1,33 @@
-from distutils.core import setup
-
-try:
- from distutils.command.build_py import build_py_2to3 as build_py
-except ImportError:
- # 2.x
- from distutils.command.build_py import build_py
+from setuptools import (
+ setup,
+ find_packages,
+)
-setup(name="beautifulsoup4",
- version = "4.3.9b1",
- author="Leonard Richardson",
- author_email='leonardr@segfault.org',
- url="http://www.crummy.com/software/BeautifulSoup/bs4/",
- download_url = "http://www.crummy.com/software/BeautifulSoup/bs4/download/",
- long_description="""Beautiful Soup sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree.""",
- license="MIT",
- packages=['bs4', 'bs4.builder', 'bs4.tests'],
- install_requires=["lxml"],
- cmdclass = {'build_py':build_py},
- classifiers=["Development Status :: 4 - Beta",
- "Intended Audience :: Developers",
- "License :: OSI Approved :: MIT License",
- "Programming Language :: Python",
- 'Programming Language :: Python :: 3',
- "Topic :: Text Processing :: Markup :: HTML",
- "Topic :: Text Processing :: Markup :: XML",
- "Topic :: Text Processing :: Markup :: SGML",
- "Topic :: Software Development :: Libraries :: Python Modules",
- ],
+setup(
+ name="beautifulsoup4",
+ version = "4.4.0",
+ author="Leonard Richardson",
+ author_email='leonardr@segfault.org',
+ url="http://www.crummy.com/software/BeautifulSoup/bs4/",
+ download_url = "http://www.crummy.com/software/BeautifulSoup/bs4/download/",
+ long_description="""Beautiful Soup sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree.""",
+ license="MIT",
+ packages=find_packages(exclude=['tests*']),
+ install_requires = ['lxml'],
+ extras_require = {
+ 'lxml' : [ 'lxml'],
+ 'html5lib' : ['html5lib'],
+ },
+ use_2to3 = True,
+ classifiers=["Development Status :: 5 - Production/Stable",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: MIT License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ 'Programming Language :: Python :: 3',
+ "Topic :: Text Processing :: Markup :: HTML",
+ "Topic :: Text Processing :: Markup :: XML",
+ "Topic :: Text Processing :: Markup :: SGML",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ ],
)