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

fix test build #144

Merged
merged 8 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
33 changes: 31 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,47 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['2.7', 'pypy-2.7', '3.9', '3.10', '3.11']
python-version: ['pypy-2.7', '3.9', '3.10', '3.11']
exclude:
- os: macos-latest
python-version: 'pypy-2.7'
- os: windows-latest
python-version: 'pypy-2.7'
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Show Python Version
run: |
python --version
cielavenir marked this conversation as resolved.
Show resolved Hide resolved
- name: Install dependencies
run: |
python -m pip install wheel
- name: Install
run: |
python -m pip -v install --global-option=--require-scandir-extension .
- name: Run tests
run: |
python test/run_tests.py
build27:
runs-on: ubuntu-latest
strategy:
fail-fast: false
cielavenir marked this conversation as resolved.
Show resolved Hide resolved
container:
image: python:2.7.18-buster
steps:
- uses: actions/checkout@v2
- name: Show Python Version
cielavenir marked this conversation as resolved.
Show resolved Hide resolved
run: |
python --version
python setup.py install
- name: Install dependencies
run: |
python -m pip install wheel
- name: Install
run: |
python -m pip -v install --global-option=--require-scandir-extension .
- name: Run tests
run: |
python test/run_tests.py
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
import sys
import logging

if '--require-scandir-extension' in sys.argv:
sys.argv = [arg for arg in sys.argv if arg != '--require-scandir-extension']
require_scandir_extension = True
else:
require_scandir_extension = False

cielavenir marked this conversation as resolved.
Show resolved Hide resolved
# Get version without importing scandir because that will lock the
# .pyd file (if scandir is already installed) so it can't be
# overwritten during the install process
Expand All @@ -42,10 +48,13 @@ def build_extension(self, ext):
try:
base_build_ext.build_extension(self, ext)
except Exception:
if require_scandir_extension:
logging.error('--require-scandir-extension is set, not falling back to Python implementation')
raise
info = sys.exc_info()
logging.warn("building %s failed with %s: %s", ext.name, info[0], info[1])

extension = Extension('_scandir', ['_scandir.c'], optional=True)
extension = Extension('_scandir', ['_scandir.c'], optional=not require_scandir_extension)


setup(
Expand Down
Loading