Skip to content

Make beautifulsoup4 an Optional Dependency #1532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ From PyPI

$ pip install atlassian-python-api

And if you want to use Crowd() or Confluence()

.. code-block:: console

$ pip install atlassian-python-api[html]

From Source

- Git clone repository
Expand Down
5 changes: 4 additions & 1 deletion atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from typing import cast

import requests
from bs4 import BeautifulSoup
try:
from bs4 import BeautifulSoup
except ImportError:
raise ImportError("Please install atlassian-python-api with extra=html like `pip install atlassian-python-api[html]`.")
from deprecated import deprecated
from requests import HTTPError

Expand Down
5 changes: 4 additions & 1 deletion atlassian/crowd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
import logging

from jmespath import search
from bs4 import BeautifulSoup
try:
from bs4 import BeautifulSoup
except ImportError:
raise ImportError("Please install atlassian-python-api with extra=html like `pip install atlassian-python-api[html]`.")

from .rest_client import AtlassianRestAPI

Expand Down
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Install package using pip:

``pip install atlassian-python-api``

and if you want to use Crowd() or Confluence() use:

``pip install atlassian-python-api[html]``

Add a connection:

.. code-block:: python
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
package_dir={"atlassian": "atlassian"},
include_package_data=True,
zip_safe=False,
install_requires=["deprecated", "requests", "oauthlib", "requests_oauthlib", "jmespath", "beautifulsoup4", "typing-extensions"],
extras_require={"kerberos": ["requests-kerberos"]},
install_requires=["deprecated", "requests", "oauthlib", "requests_oauthlib", "jmespath", "typing-extensions"],
extras_require={"kerberos": ["requests-kerberos"], "html": ["beautifulsoup4"]},
platforms="Platform Independent",
classifiers=[
"Development Status :: 4 - Beta",
Expand Down
Loading