Skip to content

Commit

Permalink
feat: 🎸 Support Python 3.13 (#47)
Browse files Browse the repository at this point in the history
* feat: 🎸 python_minifier support 3.12 & 3.13

* feat: 🎸 support Python 3.13

* perf: ⚡️ Finder file_path

* ci: 🎡 skip windows on 3.13
  • Loading branch information
ZhaoQi99 authored Nov 29, 2024
1 parent 5470c2c commit deda1ed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13, windows-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12","3.13"]
exclude:
- os: windows-latest
python-version: "3.13"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion pyencrypt/encrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
try:
import python_minifier
except ImportError as exc:
if sys.version_info.minor < 12:
if sys.version_info.minor < 14:
raise ImportError("Couldn't import python_minifier.") from exc

python_minifier = None
Expand Down
10 changes: 3 additions & 7 deletions pyencrypt/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,11 @@ def find_spec(
cls, fullname: str, path: Sequence[_Path], target: types.ModuleType = None
) -> ModuleSpec:
if path:
filename = "{}{}".format(fullname.rsplit(".", 1)[-1], ENCRYPT_SUFFIX)
if isinstance(path, _NamespacePath):
file_path = (
Path(path._path[0])
/ f'{fullname.rsplit(".", 1)[-1]}{ENCRYPT_SUFFIX}'
)
file_path = Path(path._path[0]) / filename
else:
file_path = (
Path(path[0]) / f'{fullname.rsplit(".", 1)[-1]}{ENCRYPT_SUFFIX}'
)
file_path = Path(path[0]) / filename
else:
for p in sys.path:
file_path = Path(p) / f"{fullname}{ENCRYPT_SUFFIX}"
Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers =
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython
Environment :: Console
license_files = LICENSE
Expand All @@ -33,11 +34,11 @@ keywords = python-encrypt, import-hook
install_requires =
Cython >= 0.29.30
pycryptodome >= 3.14.1
python-minifier >= 2.6.0; python_version < '3.12'
python-minifier >= 2.6.0; python_version < '3.14'
click
setuptools >= 66.1.0; python_version >= '3.12'
setuptools <= 60.9.0; python_version < '3.12'
python_requires = >=3.6,<3.13
python_requires = >=3.6,<3.14
packages = find:
# package_dir =
# = src
Expand Down

0 comments on commit deda1ed

Please sign in to comment.