Skip to content
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

Use correct name for Beautiful Soup in dependencies #1296

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

WOnder93
Copy link
Contributor

As noted at https://pypi.org/project/bs4/, the official name of the Beautiful Soup package is beautifulsoup4, while bs4 is just an alias. In distribution packaging (such as Fedora) the package may not be available under this alias, so it's better to use the official name.

As noted at https://pypi.org/project/bs4/, the official name of the
Beautiful Soup package is beautifulsoup4, while bs4 is just an alias. In
distribution packaging (such as Fedora) the package may not be available
under this alias, so it's better to use the official name.

Signed-off-by: Ondrej Mosnáček <omosnacek@gmail.com>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (03fd007) 34.36% compared to head (21f57c8) 34.36%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1296   +/-   ##
=======================================
  Coverage   34.36%   34.36%           
=======================================
  Files          45       45           
  Lines        8241     8241           
  Branches     1146     1146           
=======================================
  Hits         2832     2832           
  Misses       5295     5295           
  Partials      114      114           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gonchik
Copy link
Member

gonchik commented Jan 16, 2024

Thanks, I have not known

@gonchik gonchik merged commit d8e9ffd into atlassian-api:master Jan 16, 2024
10 checks passed
@FCamborda
Copy link
Contributor

This should've been added to setup.py too for the pypi distribution, right? This only fixes the Tox env and the source installation

@WOnder93
Copy link
Contributor Author

setup.py doesn't contain any bs4 references, no? Or am I missing something?

@gsemet
Copy link

gsemet commented Jan 16, 2024

The official package is "beautifulsoup4", yes, but the module inside is bs4.

from beautifulsoup4 import BeautifulSoup

does not work. It should be:

from bs4 import BeautifulSoup

See the official documentation:
https://pypi.org/project/beautifulsoup4/

image

@FCamborda
Copy link
Contributor

setup.py doesn't contain any bs4 references, no? Or am I missing something?

Exactly, that's the issue. install_requires should mention explicitly all direct dependencies, in this case beautifulsoup4.
Probably one of the other dependencies declared bs4 as a dependency and has now removed it, hence why before beautifulsoup4 was installed transitively.

The import statement should be from bs4 import BeautifulSoup, as the documentation says.
(The package name is taken as-is from the directory containing the file __init__.py. In this case bs4 https://git.launchpad.net/beautifulsoup/tree/bs4?h=4.13)

@alexandre-fabra
Copy link
Contributor

This is the new error message with 3.41.6:

Traceback (most recent call last):
  File "C:\python\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\python\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\day9lr\AppData\Local\Temp\venv\onedriving\Scripts\onedriving.exe\__main__.py", line 4, in <module>
  File "C:\Users\day9lr\AppData\Local\Temp\venv\onedriving\lib\site-packages\cli\od.py", line 10, in <module>
    from dx_pr_manager import cli as pr_manager_cli
  File "C:\Users\day9lr\AppData\Local\Temp\venv\onedriving\lib\site-packages\dx_pr_manager\cli.py", line 10, in <module>
    from dx_pr_manager import pr_manager
  File "C:\Users\day9lr\AppData\Local\Temp\venv\onedriving\lib\site-packages\dx_pr_manager\pr_manager.py", line 10, in <module>
    from dx_core.bitbucket import BitBucket  # type: ignore
  File "C:\Users\day9lr\AppData\Local\Temp\venv\onedriving\lib\site-packages\dx_core\bitbucket.py", line 6, in <module>
    from atlassian import Bitbucket
  File "C:\Users\day9lr\AppData\Local\Temp\venv\onedriving\lib\site-packages\atlassian\__init__.py", line 5, in <module>
    from .confluence import Confluence
  File "C:\Users\day9lr\AppData\Local\Temp\venv\onedriving\lib\site-packages\atlassian\confluence.py", line 10, in <module>
    from beautifulsoup4 import BeautifulSoup
ModuleNotFoundError: No module named 'beautifulsoup4'

@alonsomoya
Copy link

same here

11:22:50  /usr/local/lib/python3.10/site-packages/atlassian/__init__.py:5: in <module>
11:22:50      from .confluence import Confluence
11:22:50  /usr/local/lib/python3.10/site-packages/atlassian/confluence.py:10: in <module>
11:22:50      from beautifulsoup4 import BeautifulSoup
11:22:50  E   ModuleNotFoundError: No module named 'beautifulsoup4'

@OmerFarukMerey
Copy link

I have the same issue here for release 3.41.6
image

@gsemet
Copy link

gsemet commented Jan 16, 2024

from bs4 import BeautifulSoup

not difficult, just follow the doc

@OmerFarukMerey
Copy link

OmerFarukMerey commented Jan 16, 2024

from bs4 import BeautifulSoup

not difficult, just follow the doc

This is not an useful comment. The problem still arises.
see: #1295

@zbika73
Copy link
Contributor

zbika73 commented Jan 16, 2024

Check this PR addressing requirements.txt file as a source of dependencies
#1298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants