File tree Expand file tree Collapse file tree 6 files changed +41
-7
lines changed
Expand file tree Collapse file tree 6 files changed +41
-7
lines changed Original file line number Diff line number Diff line change 8585 skip_existing : true
8686
8787 - name : Publish to PyPI
88- if : github.ref == 'refs/heads/master'
88+ if : startsWith( github.ref, 'refs/tags')
8989 uses : pypa/gh-action-pypi-publish@master
9090 with :
9191 password : ${{ secrets.PYPI_TOKEN }} # defined in Github repository
Original file line number Diff line number Diff line change @@ -15,12 +15,21 @@ Retrieves xkcd comic data and metadata as python objects.
1515Asynchronous ([ async] ( https://docs.python.org/3/library/asyncio.html ) ) and synchronous implementations.
1616
1717## Installation
18- At the command line, with ` pip ` :
18+ At the command line, with ` pip ` ,
19+
20+ synchronous implementation:
1921``` sh
20- $ pip install xkcd-wrapper
22+ $ pip install xkcd-wrapper[sync]
23+ ```
24+
25+ async implementation:
26+ ``` sh
27+ $ pip install xkcd-wrapper[async]
2128```
2229
2330## Usage
31+
32+ synchronous:
2433``` python
2534>> > import xkcd_wrapper
2635
Original file line number Diff line number Diff line change 11# History
22
3+ ### 0.2.1 (11-08-2020)
4+ * Separate dependencies
5+ (you can now use the async implementation without having to install the sync dependencies and vice versa)
6+
37### 0.2.0 (08-08-2020)
48* Async implementation
59
Original file line number Diff line number Diff line change 11# Installation
2- At the command line, with ` pip ` :
2+ At the command line, with ` pip ` ,
3+
4+ synchronous implementation:
35``` sh
4- $ pip install xkcd-wrapper
6+ $ pip install xkcd-wrapper[sync]
7+ ```
8+
9+ async implementation:
10+ ``` sh
11+ $ pip install xkcd-wrapper[async]
512```
Original file line number Diff line number Diff line change 1818 open ('requirements.txt' , encoding = 'utf-8' ) as requirements_txt :
1919 README = readme_md .read ()
2020 HISTORY = history_md .read ()
21- REQUIREMENTS = [req [:req .find ('#' )].rstrip () for req in requirements_txt .readlines ()]
21+
22+ REQUIREMENTS = []
23+ REQUIREMENTS_EXTRA = {}
24+ for req in requirements_txt .readlines ():
25+ req = req [:req .find ('#' )].rstrip () # remove comments
26+ if req .startswith ("requests" ):
27+ REQUIREMENTS_EXTRA ["requests" ] = req
28+ elif req .startswith ("aiohttp" ):
29+ REQUIREMENTS_EXTRA ["aiohttp" ] = req
30+ else :
31+ REQUIREMENTS .append (req )
2232
2333setup (
2434 name = 'xkcd-wrapper' ,
3444 package_dir = {'xkcd_wrapper' : 'xkcd_wrapper' },
3545 include_package_data = True ,
3646 install_requires = REQUIREMENTS ,
47+ extras_require = {
48+ "sync" : [REQUIREMENTS_EXTRA ["requests" ]],
49+ "async" : [REQUIREMENTS_EXTRA ["aiohttp" ]],
50+ },
3751 zip_safe = False ,
3852 keywords = 'xkcd wrapper xkcd-wrapper' ,
3953 classifiers = [
Original file line number Diff line number Diff line change 2727__author__ = 'Pedro HC David, https://github.com/Kronopt'
2828__credits__ = ['Pedro HC David' ]
2929__license__ = 'GPLv3'
30- __version__ = '0.2.0 '
30+ __version__ = '0.2.1 '
3131
3232
3333from .client import Client
You can’t perform that action at this time.
0 commit comments