Skip to content

Commit

Permalink
Add Python 3.13 support and prepare for release (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 authored Nov 11, 2024
1 parent a0b8544 commit 5ed9336
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 42 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,40 @@ jobs:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
python-arch:
- x86
- x64
- arm64

exclude:
# Exclude OS and arch combinations that are not supported
- os: ubuntu-latest
python-arch: x86
- os: macOS-latest
- os: ubuntu-latest
python-arch: arm64
- os: windows-2019
python-arch: x86
- os: windows-2019
python-arch: arm64
- os: windows-2022
python-arch: arm64
- os: macOS-latest
python-version: 3.8
python-arch: x86
- os: macOS-latest
python-version: 3.9
python-arch: x64

# macOS arm64 is supported from 3.9
- os: macOS-latest
python-version: '3.10'
- os: windows-2019
python-arch: x86
python-version: 3.8
- os: windows-2019
python-version: 3.8
- os: windows-2019
python-version: 3.9
- os: windows-2019
python-version: '3.10'
- os: windows-2019
python-version: '3.11'
- os: windows-2019
python-version: '3.12'

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog

## 1.14.1 - TBD
## 1.14.1 - 2024-11-12

* Update session id lookup logic to comply with MS-SMB2 spec
* Remove connection from global connection cache even if failing to close it
* Added official support for Python 3.13

## 1.14.0 - 2024-08-26

Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,12 @@ by running;
# Recommend to have virtual environment installed at .venv path.
pip install -r requirements-dev.txt
pip install -e .

# you can also run tox by installing tox
pip install tox
```

From there to run the basic tests run;

```bash
py.test -v --cov smbprotocol --cov-report term-missing

# or with tox for dedicated virtual environments and multiple Python versions.
tox
python -m pytest -v --cov smbprotocol --cov-report term-missing
```

Before sending the code for review, besides making sure all the test pass,
Expand All @@ -258,7 +252,7 @@ To run these tests set the following variables;
* `SMB_PORT`: The port the SMB server is listening on, default is `445`
* `SMB_SHARE`: The name of the share to connect to, a share with this name must exist as well as a share with the name`$SMB_SHARE-encrypted` must also exist that forces encryption

From here running `tox` or `py.test` with these environment variables set will
From here running `pytest` with these environment variables set will
activate the integration tests.

This requires either Windows 10 or Server 2016 as they support Dialect 3.1.1
Expand Down
26 changes: 2 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
]
dependencies = [
"cryptography >= 2.0",
Expand Down Expand Up @@ -62,26 +63,3 @@ profile = "black"
[tool.pytest.ini_options]
testpaths = "tests"
addopts = "--import-mode=importlib"

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = sanity,py38,py39,py310,py311,py312
skip_missing_interpreters = true
isolated_build = true
[testenv]
deps =
-r{toxinidir}/requirements-dev.txt
commands =
python -m pytest -v --cov smbclient --cov smbprotocol --cov-report term-missing
passenv =
SMB_*
[testenv:sanity]
commands =
python -m black . --check
python -m isort . --check-only
"""
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ pyspnego
pytest
pytest-cov
pytest-mock
tox
7 changes: 5 additions & 2 deletions tests/test_smbclient_shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,12 @@ def test_copymode_local_to_local_symlink_dont_follow(tmpdir):
os.symlink(src_filename, src_link)
os.symlink(dst_filename, dst_link)

expected = "chmod: follow_symlinks unavailable on this platform"
with pytest.raises(NotImplementedError, match=re.escape(expected)):
if os.name == "nt" and sys.version_info >= (3, 13):
copymode(src_link, dst_link, follow_symlinks=False)
else:
expected = "chmod: follow_symlinks unavailable on this platform"
with pytest.raises(NotImplementedError, match=re.escape(expected)):
copymode(src_link, dst_link, follow_symlinks=False)


def test_copymode_missing_src(smb_share):
Expand Down

0 comments on commit 5ed9336

Please sign in to comment.