Skip to content

Commit deda1ed

Browse files
authored
feat: 🎸 Support Python 3.13 (#47)
* feat: 🎸 python_minifier support 3.12 & 3.13 * feat: 🎸 support Python 3.13 * perf: ⚡️ Finder file_path * ci: 🎡 skip windows on 3.13
1 parent 5470c2c commit deda1ed

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ubuntu-20.04, macos-13, windows-latest]
23-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
23+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12","3.13"]
24+
exclude:
25+
- os: windows-latest
26+
python-version: "3.13"
2427
runs-on: ${{ matrix.os }}
2528
steps:
2629
- uses: actions/checkout@v4

pyencrypt/encrypt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
try:
88
import python_minifier
99
except ImportError as exc:
10-
if sys.version_info.minor < 12:
10+
if sys.version_info.minor < 14:
1111
raise ImportError("Couldn't import python_minifier.") from exc
1212

1313
python_minifier = None

pyencrypt/loader.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,11 @@ def find_spec(
9191
cls, fullname: str, path: Sequence[_Path], target: types.ModuleType = None
9292
) -> ModuleSpec:
9393
if path:
94+
filename = "{}{}".format(fullname.rsplit(".", 1)[-1], ENCRYPT_SUFFIX)
9495
if isinstance(path, _NamespacePath):
95-
file_path = (
96-
Path(path._path[0])
97-
/ f'{fullname.rsplit(".", 1)[-1]}{ENCRYPT_SUFFIX}'
98-
)
96+
file_path = Path(path._path[0]) / filename
9997
else:
100-
file_path = (
101-
Path(path[0]) / f'{fullname.rsplit(".", 1)[-1]}{ENCRYPT_SUFFIX}'
102-
)
98+
file_path = Path(path[0]) / filename
10399
else:
104100
for p in sys.path:
105101
file_path = Path(p) / f"{fullname}{ENCRYPT_SUFFIX}"

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ classifiers =
2121
Programming Language :: Python :: 3.10
2222
Programming Language :: Python :: 3.11
2323
Programming Language :: Python :: 3.12
24+
Programming Language :: Python :: 3.13
2425
Programming Language :: Python :: Implementation :: CPython
2526
Environment :: Console
2627
license_files = LICENSE
@@ -33,11 +34,11 @@ keywords = python-encrypt, import-hook
3334
install_requires =
3435
Cython >= 0.29.30
3536
pycryptodome >= 3.14.1
36-
python-minifier >= 2.6.0; python_version < '3.12'
37+
python-minifier >= 2.6.0; python_version < '3.14'
3738
click
3839
setuptools >= 66.1.0; python_version >= '3.12'
3940
setuptools <= 60.9.0; python_version < '3.12'
40-
python_requires = >=3.6,<3.13
41+
python_requires = >=3.6,<3.14
4142
packages = find:
4243
# package_dir =
4344
# = src

0 commit comments

Comments
 (0)