Mentions légales du service

Skip to content
Snippets Groups Projects
Unverified Commit a676f7b3 authored by Henry Schreiner's avatar Henry Schreiner Committed by GitHub
Browse files

chore: bump versions (#16)

* chore: bump to version 2.7.1 & add nox

* ci: run simpler & more Windows runs
parent d9207bc7
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ jobs: ...@@ -32,7 +32,7 @@ jobs:
channels: conda-forge channels: conda-forge
- name: Prepare - name: Prepare
run: conda install conda-build conda-verify run: conda install conda-build conda-verify pytest
- name: Build - name: Build
run: conda build conda.recipe run: conda build conda.recipe
...@@ -41,4 +41,4 @@ jobs: ...@@ -41,4 +41,4 @@ jobs:
run: conda install -c ${CONDA_PREFIX}/conda-bld/ scikit_build_example run: conda install -c ${CONDA_PREFIX}/conda-bld/ scikit_build_example
- name: Test - name: Test
run: python tests/test.py run: pytest tests
...@@ -8,36 +8,13 @@ on: ...@@ -8,36 +8,13 @@ on:
- master - master
jobs: jobs:
make_dist:
name: Make distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: pybind/pybind11
- uses: actions/setup-python@v2
- name: Download requirements
run: python -m pip install build
- name: Build files
run: |
python -m build
PYBIND11_GLOBAL_SDIST=ON python -m build
- uses: actions/upload-artifact@v2
with:
path: dist/*
build: build:
name: Build with Pip name: Build with Pip
needs: [make_dist]
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [windows-latest, macos-latest, ubuntu-latest] platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ["2.7", "3.5", "3.8"] python-version: ["2.7", "3.5", "3.9", "3.10-dev"]
exclude: exclude:
# Not supported by scikit-build # Not supported by scikit-build
...@@ -49,11 +26,6 @@ jobs: ...@@ -49,11 +26,6 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
...@@ -61,16 +33,8 @@ jobs: ...@@ -61,16 +33,8 @@ jobs:
- name: Add requirements - name: Add requirements
run: python -m pip install --upgrade wheel setuptools run: python -m pip install --upgrade wheel setuptools
# Eventually Microsoft might have an action for setting up
# MSVC, but for now, this action works:
- name: Prepare compiler environment for Windows 🐍 2.7
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.9.0
with:
arch: x64
- name: Build and install - name: Build and install
run: pip install --verbose . --find-links ${{ github.workspace }}/dist run: pip install --verbose .[test]
- name: Test - name: Test
run: python tests/test.py run: pytest
...@@ -11,7 +11,8 @@ on: ...@@ -11,7 +11,8 @@ on:
- published - published
env: env:
CIBW_TEST_COMMAND: python {project}/tests/test.py CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_TEST_EXTRAS: test
jobs: jobs:
...@@ -40,7 +41,7 @@ jobs: ...@@ -40,7 +41,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest] # Windows wheels currently not supported very well by scikit-build os: [ubuntu-latest, macos-latest, windows-latest]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
......
...@@ -28,10 +28,12 @@ requirements: ...@@ -28,10 +28,12 @@ requirements:
test: test:
imports: imports:
- scikit_build_example - scikit_build_example
requires:
- pytest
source_files: source_files:
- tests - tests
commands: commands:
- python tests/test.py - pytest tests
about: about:
summary: An example project built with pybind11 and scikit-build. summary: An example project built with pybind11 and scikit-build.
......
import nox
nox.options.sessions = ["lint", "tests"]
@nox.session
def lint(session: nox.Session) -> None:
"""
Run the linter.
"""
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files", *session.posargs)
@nox.session
def tests(session: nox.Session) -> None:
"""
Run the unit and regular tests.
"""
session.install(".[test]")
session.run("pytest", *session.posargs)
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
requires = [ requires = [
"setuptools>=42", "setuptools>=42",
"wheel", "wheel",
"pybind11~=2.6.0", "pybind11>=2.7.1",
"cmake", "cmake>=3.21",
"scikit-build", "scikit-build>=0.12",
] ]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
...@@ -27,4 +27,5 @@ setup( ...@@ -27,4 +27,5 @@ setup(
package_dir={"": "src"}, package_dir={"": "src"},
cmake_install_dir="src/scikit_build_example", cmake_install_dir="src/scikit_build_example",
include_package_data = True, include_package_data = True,
extras_require={"test": ["pytest"]},
) )
# -*- coding: utf-8 -*-
import scikit_build_example as m
assert m.__version__ == "0.0.1"
assert m.add(1, 2) == 3
assert m.subtract(1, 2) == -1
# -*- coding: utf-8 -*-
import scikit_build_example as m
def test_version():
assert m.__version__ == "0.0.1"
def test_add():
assert m.add(1, 2) == 3
def test_sub():
assert m.subtract(1, 2) == -1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment