Skip to content

Commit

Permalink
Merge pull request explosion#94 from adrianeboyd/ci/gha-v1.x
Browse files Browse the repository at this point in the history
CI: Switch to GHA for v1.x
  • Loading branch information
adrianeboyd committed Jul 18, 2023
2 parents a90d501 + 28bf2dd commit dc529e9
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 108 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/tests.yml
@@ -0,0 +1,76 @@
name: tests

on:
push:
paths-ignore:
- "*.md"
pull_request:
types: [opened, synchronize, reopened, edited]
paths-ignore:
- "*.md"

env:
MODULE_NAME: 'srsly'
RUN_MYPY: 'false'

jobs:
tests:
name: Test
if: github.repository_owner == 'explosion'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
include:
- os: windows-2019
python_version: "3.6"
- os: ubuntu-20.04
python_version: "3.6"
runs-on: ${{ matrix.os }}

steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Configure Python version
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
architecture: x64

- name: Build sdist
run: |
python -m pip install -U build pip setuptools
python -m pip install -U -r requirements.txt
python -m build --sdist
- name: Delete source directory
shell: bash
run: |
rm -rf $MODULE_NAME
- name: Uninstall all packages
run: |
python -m pip freeze > installed.txt
python -m pip uninstall -y -r installed.txt
- name: Install from sdist
shell: bash
run: |
SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
python -m pip install dist/$SDIST
- name: Test import
shell: bash
run: |
python -c "import $MODULE_NAME" -Werror
- name: Install test requirements
run: |
python -m pip install -U -r requirements.txt
- name: Run tests
shell: bash
run: |
python -m pytest --pyargs $MODULE_NAME
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -7,7 +7,7 @@ standalone package, with a high-level API that makes it easy to write code
that's correct across platforms and Pythons. This allows us to provide all the
serialization utilities we need in a single binary wheel.

[![Azure Pipelines](https://img.shields.io/azure-devops/build/explosion-ai/public/4/master.svg?logo=azure-pipelines&style=flat-square)](https://dev.azure.com/explosion-ai/public/_build?definitionId=4)
[![tests](https://github.com/explosion/srsly/actions/workflows/tests.yml/badge.svg)](https://github.com/explosion/srsly/actions/workflows/tests.yml)
[![PyPi](https://img.shields.io/pypi/v/srsly.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.python.org/pypi/srsly)
[![conda](https://img.shields.io/conda/vn/conda-forge/srsly.svg?style=flat-square&logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/srsly)
[![GitHub](https://img.shields.io/github/release/explosion/srsly/all.svg?style=flat-square&logo=github)](https://github.com/explosion/srsly)
Expand Down
102 changes: 0 additions & 102 deletions azure-pipelines.yml

This file was deleted.

2 changes: 0 additions & 2 deletions requirements.txt
Expand Up @@ -2,8 +2,6 @@
cython>=0.29.1,<3.0
pytest>=5.2.0,!=7.1.0
pytest-timeout>=1.3.3,<2.0.0
unittest2==1.1.0; python_version < "3.4"
pytz==2018.7
mock>=2.0.0,<3.0.0
numpy>=1.15.0
psutil
11 changes: 9 additions & 2 deletions srsly/tests/cloudpickle/cloudpickle_test.py
Expand Up @@ -870,8 +870,12 @@ def test_builtin_classicmethod(self):


@pytest.mark.skipif(
platform.machine() == "aarch64" and sys.version_info[:2] >= (3, 10),
reason="Fails on aarch64 + python 3.10+ in cibuildwheel, currently unable to replicate failure elsewhere")
(platform.machine() == "aarch64" and sys.version_info[:2] >= (3, 10))
or platform.python_implementation() == "PyPy"
or (sys.version_info[:2] == (3, 10) and sys.version_info >= (3, 10, 8))
# Skipping tests on 3.11 due to https://github.com/cloudpipe/cloudpickle/pull/486.
or sys.version_info[:2] == (3, 11),
reason="Fails on aarch64 + python 3.10+ in cibuildwheel, currently unable to replicate failure elsewhere; fails sometimes for pypy on conda-forge; fails for python 3.10.8+ and 3.11")
def test_builtin_classmethod(self):
obj = 1.5 # float object

Expand Down Expand Up @@ -1470,6 +1474,7 @@ def foo():
finally:
sys.modules.pop("_faulty_module", None)

@pytest.mark.skip(reason="fails for pytest v7.2.0")
def test_dynamic_pytest_module(self):
# Test case for pull request https://github.com/cloudpipe/cloudpickle/pull/116
import py
Expand Down Expand Up @@ -1567,6 +1572,8 @@ def test_namedtuple(self):
assert isinstance(depickled_t2, MyTuple)
assert depickled_t2 == t2

@pytest.mark.skipif(platform.python_implementation() == "PyPy",
reason="fails sometimes for pypy on conda-forge")
def test_interactively_defined_function(self):
# Check that callables defined in the __main__ module of a Python
# script (or jupyter kernel) can be pickled / unpickled / executed.
Expand Down
1 change: 0 additions & 1 deletion srsly/tests/ujson/test_ujson.py
Expand Up @@ -10,7 +10,6 @@
import math
import time
import sys
import pytz
import pytest

if six.PY2:
Expand Down

0 comments on commit dc529e9

Please sign in to comment.