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

backport python test suite and type stubs from master #91

Draft
wants to merge 2 commits into
base: merge-base-RC_1_2
Choose a base branch
from
Draft
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
47 changes: 11 additions & 36 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04, macos-latest, windows-latest ]

Expand All @@ -29,7 +30,7 @@ jobs:
run: |
brew update
brew install boost-build boost boost-python3 [email protected] [email protected]
export PATH=$(brew --prefix)/opt/[email protected]/bin:$PATH
echo $(brew --prefix)/opt/[email protected]/bin >> ${GITHUB_PATH}

- name: update package lists (linux)
if: runner.os == 'Linux'
Expand Down Expand Up @@ -75,47 +76,21 @@ jobs:
max_attempts: 3
command: choco install openssl --limitoutput

- name: build/install (windows)
- name: test with tox (windows)
if: runner.os == 'Windows'
shell: cmd
run: |
set BOOST_ROOT=%CD%\boost
set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build
set PATH=%BOOST_ROOT%;%PATH%

cd bindings\python
python setup.py build_ext install --user --prefix=
python -m pip install --upgrade pip
python -m pip install tox
python -m tox -e py

- name: tests (windows)
if: runner.os == 'Windows'
shell: cmd
run: |
cd bindings\python
python test.py

- name: build/install (Linux)
if: runner.os == 'Linux'
run: |
cd bindings/python
python3 setup.py build_ext install --user --prefix=

- name: build/install (MacOS)
if: runner.os == 'macOS'
run: |
# Install to Homebrew's python site-packages. no need for --user and --prefix
cd bindings/python
export PATH=$(brew --prefix)/opt/[email protected]/bin:$PATH
python3 setup.py build_ext install --install-lib $(brew --prefix)/lib/python3.10/site-packages

- name: tests (Linux)
if: runner.os == 'Linux'
run: |
cd bindings/python
python3 test.py

- name: tests (MacOS)
if: runner.os == 'macOS'
- name: test with tox
if: runner.os != 'Windows'
run: |
cd bindings/python
export PATH=$(brew --prefix)/opt/[email protected]/bin:$PATH
python3 test.py
python3 -m pip install --upgrade pip
python3 -m pip install tox
python3 -m tox -e py
12 changes: 0 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ repos:
(?x)^(
# Enable these later, avoid bloating this PR
bindings/python/client.py|
bindings/python/dummy_data.py|
bindings/python/make_torrent.py|
bindings/python/simple_client.py|
bindings/python/test.py|
docs/gen_reference_doc.py|
examples/run_benchmarks.py|
fuzzers/tools/generate_initial_corpus.py|
Expand All @@ -70,11 +68,6 @@ repos:
hooks:
- id: autoflake
args: [--in-place, --remove-unused-variables, --remove-all-unused-imports, --remove-duplicate-keys]
# Avoiding PR bloat
exclude: |
(?x)^(
bindings/python/test.py
)
- repo: https://github.com/python/black
rev: 22.8.0
hooks:
Expand All @@ -83,10 +76,8 @@ repos:
exclude: |
(?x)^(
bindings/python/client.py|
bindings/python/dummy_data.py|
bindings/python/make_torrent.py|
bindings/python/simple_client.py|
bindings/python/test.py|
docs/filter-rst.py|
docs/gen_settings_doc.py|
docs/gen_reference_doc.py|
Expand Down Expand Up @@ -126,9 +117,7 @@ repos:
exclude: |
(?x)^(
bindings/python/client.py|
bindings/python/dummy_data.py|
bindings/python/make_torrent.py|
bindings/python/test.py|
docs/filter-rst.py|
docs/gen_reference_doc.py|
docs/gen_settings_doc.py|
Expand Down Expand Up @@ -163,7 +152,6 @@ repos:
# Enable these later, avoid bloating this PR
bindings/python/client.py|
bindings/python/make_torrent.py|
bindings/python/test.py|
docs/gen_settings_doc.py|
docs/gen_todo.py|
docs/gen_reference_doc.py|
Expand Down
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* type stubs are now included with the python bindings
* fix wanted_done/done accounting when force-rechecking
* expose userdata via torrent_handle (back-port from 2.0)
* fix renaming of filenames that are too long for the filesystem
Expand Down
7 changes: 0 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@ test_script:
appveyor-retry b2.exe -l500 --hash openssl-version=pre1.1 warnings=all warnings-as-errors=on -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% asserts=on export-extra=on openssl-lib="c:\\OpenSSL-Win%model%\\lib" openssl-include="c:\\OpenSSL-Win%model%\\include"
)

- cd %ROOT_DIRECTORY%\bindings\python
# we use 64 bit python build
- if defined python (
copy dependencies\*.* .
& c:\Python37-x64\python.exe test.py -b
)

- if defined cmake (
appveyor-retry ctest
)
Expand Down
34 changes: 0 additions & 34 deletions bindings/python/dummy_data.py

This file was deleted.

Loading