Sublime Forum

Adding Beautiful Soup 4.4.1 as a dependency

#1

Hi,

I am trying to add Beautiful Soup 4.4.1 as a dependency (this is bs4 after running 2to3). The repository is here and I already created a pull request for the package control channel here. Now I realize that something might actually not work but I don’t know what the problem is. Any advice?

Thanks!

0 Likes

#2

You need to do a release with a valid semver https://github.com/jlegewie/sublime-beautifulsoup4/releases. So probably a release 1.0.0.

1 Like

#3

I didn’t test it extensively, you will have to do that, but it seemed to work. I would release a semver tag, and test it before release.

>>> from bs4 import BeautifulSoup
>>> html_doc = """
<html><head><title>The Dormouse's story</title></head>
<body>
<p class="title"><b>The Dormouse's story</b></p>

<p class="story">Once upon a time there were three little sisters; and their names were
<a href="http://example.com/elsie" class="sister" id="link1">Elsie</a>,
<a href="http://example.com/lacie" class="sister" id="link2">Lacie</a> and
<a href="http://example.com/tillie" class="sister" id="link3">Tillie</a>;
and they lived at the bottom of a well.</p>

<p class="story">...</p>
"""
>>> soup = BeautifulSoup(html_doc, 'html.parser')
>>> print(soup.prettify())
<html>
 <head>
  <title>
   The Dormouse's story
  </title>
 </head>
 <body>
  <p class="title">
   <b>
    The Dormouse's story
   </b>
  </p>
  <p class="story">
   Once upon a time there were three little sisters; and their names were
   <a class="sister" href="http://example.com/elsie" id="link1">
    Elsie
   </a>
   ,
   <a class="sister" href="http://example.com/lacie" id="link2">
    Lacie
   </a>
   and
   <a class="sister" href="http://example.com/tillie" id="link3">
    Tillie
   </a>
   ;
and they lived at the bottom of a well.
  </p>
  <p class="story">
   ...
  </p>
 </body>
</html>
2 Likes

#4

Awesome, that worked and Beautiful Soup seems to run perfectly from ST.

0 Likes