Skip to content

Commit a8a43a3

Browse files
authored
Merge pull request #4 from Kronopt/develop
Develop
2 parents 9d5203a + fa917f8 commit a8a43a3

File tree

6 files changed

+41
-7
lines changed

6 files changed

+41
-7
lines changed

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
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

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ Retrieves xkcd comic data and metadata as python objects.
1515
Asynchronous ([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

docs/history.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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

docs/installation.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
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
```

setup.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@
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

2333
setup(
2434
name='xkcd-wrapper',
@@ -34,6 +44,10 @@
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=[

xkcd_wrapper/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
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

3333
from .client import Client

0 commit comments

Comments
 (0)