Skip to content

Commit a1d9e3a

Browse files
committed
Merge branch 'release/v1.2.1'
2 parents 2014343 + 23017af commit a1d9e3a

File tree

8 files changed

+41
-14
lines changed

8 files changed

+41
-14
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
fail-fast: false
1616
steps:
1717
- name: Checkout code
18-
uses: actions/checkout@v4.1.1
18+
uses: actions/checkout@v4.1.6
1919

2020
- name: Set up python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

@@ -32,15 +32,15 @@ jobs:
3232
run: echo "$(pipenv --venv)/bin" >> $GITHUB_PATH
3333

3434
- name: Run pyright (Linux)
35-
uses: jakebailey/pyright-action@v1.8.1
35+
uses: jakebailey/pyright-action@v2.3.1
3636
with:
3737
python-version: ${{ matrix.python-version }}
3838
python-platform: Linux
3939
no-comments: true
4040
warnings: true
4141

4242
- name: Run pyright (Windows)
43-
uses: jakebailey/pyright-action@v1.8.1
43+
uses: jakebailey/pyright-action@v2.3.1
4444
# run anyway
4545
if: success() || failure()
4646
with:

.vscode/settings.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"esbonio.sphinx.confDir": "",
3-
"python.formatting.provider": "none",
42
"[python]": {
53
"editor.formatOnSaveMode": "file",
64
"editor.formatOnSave": true,

Pipfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7-
sphinx = "~=7.2"
8-
mypy = "~=1.8"
7+
sphinx = "~=7.3"
8+
mypy = "~=1.10"
99
yapf = "~=0.40"
1010
twine = "*"
1111
matplotlib = "*"
1212
pandas = "*"
13-
torf-cli = {file = "https://github.com/rndusr/torf-cli/archive/refs/heads/master.zip"}
1413
faker = "*"
1514
pydocstyle = "*"
1615
pylint = "*"

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ You can install py3createtorrent by executing:
4343

4444
pip3 install py3createtorrent
4545

46-
Of course, you need to have Python 3 installed on your system. py3createtorrent requires Python 3.5 or later.
46+
Of course, you need to have Python 3 installed on your system. py3createtorrent requires Python 3.5 or later. For using
47+
Python 3.5 to 3.7 you need to install the ``typing-extensions`` module.
4748

4849
Full documentation
4950
------------------

docs/source/changelog.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
Changelog
22
=========
33

4-
Version 1.2.0b1 (beta)
4+
Version 1.2.1
5+
-------------
6+
7+
*Release date: 2024/06/08*
8+
9+
* Fix support for Python 3.7 and earlier. Users have to install the ``typing-extensions`` module, though.
10+
* Attempt to fix the UnicodeEncodeErrors (or similar) that occur when printing files/paths with rare characters that are not
11+
compatible with the console's codec. See `#33 <https://github.com/rsnitsch/py3createtorrent/issues/33>`_.
12+
13+
Version 1.2.1b1 (beta)
514
----------------------
615

716
*Release date: 2024/02/13*

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# The short X.Y version.
5151
version = '1.2'
5252
# The full version, including alpha/beta/rc tags.
53-
release = '1.2.1b1'
53+
release = '1.2.1'
5454

5555
# The language for content autogenerated by Sphinx. Refer to documentation
5656
# for a list of supported languages.

docs/source/user.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Requirements
2525

2626
py3createtorrent requires at least Python 3.5 and the `bencode.py <https://pypi.org/project/bencode.py/>`_ module.
2727

28+
For using Python 3.5 to 3.7 you need to install the ``typing-extensions`` module::
29+
30+
pip install typing-extensions
31+
2832
.. note::
2933

3034
It may be possible to use the script with older Python versions. For Python 3.2, 3.3, 3.4 you need to install

src/py3createtorrent.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,23 @@
2424
import time
2525
import urllib.error
2626
import urllib.request
27-
from typing import Any, Dict, List, Literal, Optional, Pattern, Set, Union
27+
from typing import Any, Dict, List, Optional, Pattern, Set, Union
28+
29+
# Literal was introducted in Python 3.8.
30+
try:
31+
from typing import Literal
32+
except ImportError:
33+
try:
34+
from typing_extensions import Literal
35+
except ImportError:
36+
print("ERROR:")
37+
print("Missing type annotations. Are you using an older Python version?")
38+
print("Please install the typing-extensions module and try again.")
39+
print("You can install it by executing:")
40+
print(" pip install typing-extensions")
41+
print("-" * 40)
42+
print()
43+
raise
2844

2945
try:
3046
from bencodepy import encode as bencode
@@ -44,7 +60,7 @@
4460

4561
# Do not touch anything below this line unless you know what you're doing!
4662

47-
__version__ = "1.2.1b1"
63+
__version__ = "1.2.1"
4864

4965
# Note:
5066
# Kilobyte = kB = 1000 Bytes

0 commit comments

Comments
 (0)