Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.13 #47

Merged
merged 4 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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