Skip to content

Commit

Permalink
Support Python 3.7+ (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Jul 18, 2022
1 parent 9b15d0e commit 0d21b04
Show file tree
Hide file tree
Showing 12 changed files with 175 additions and 228 deletions.
29 changes: 0 additions & 29 deletions .appveyor.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on: [push, pull_request]

jobs:
Windows:
name: 'Windows (${{ matrix.python }})'
runs-on: 'windows-latest'
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: test-requirements.txt
- name: Run tests
run: ./ci.sh
shell: bash
env:
# Should match 'name:' up above
JOB_NAME: 'Windows (${{ matrix.python }})'

Ubuntu:
name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'
timeout-minutes: 10
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11-dev']
check_formatting: ['0']
extra_name: ['']
include:
- python: '3.10'
check_formatting: '1'
extra_name: ', check formatting'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
if: "!endsWith(matrix.python, '-dev')"
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: test-requirements.txt
- name: Setup python (dev)
uses: deadsnakes/action@v2.0.2
if: endsWith(matrix.python, '-dev')
with:
python-version: '${{ matrix.python }}'
- name: Run tests
run: ./ci.sh
env:
CHECK_FORMATTING: '${{ matrix.check_formatting }}'
# Should match 'name:' up above
JOB_NAME: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'

macOS:
name: 'macOS (${{ matrix.python }})'
timeout-minutes: 10
runs-on: 'macos-latest'
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: test-requirements.txt
- name: Run tests
run: ./ci.sh
env:
# Should match 'name:' up above
JOB_NAME: 'macOS (${{ matrix.python }})'
6 changes: 0 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ formats:

requirements_file: ci/rtd-requirements.txt

# Currently RTD's default image only has 3.5
# This gets us 3.6 (and hopefully 3.7 in the future)
# https://docs.readthedocs.io/en/latest/yaml-config.html#build-image
build:
image: latest

python:
version: 3
pip_install: True
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

60 changes: 60 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

set -ex

BLACK_VERSION=22.6.0

pip install -U pip setuptools wheel

python setup.py sdist --formats=zip
pip install dist/*.zip

if [ "$CHECK_FORMATTING" = "1" ]; then
pip install black==${BLACK_VERSION} isort>=5
if ! black --diff setup.py src tests; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Formatting problems were found (listed above). To fix them, run
pip install black==$BLACK_VERSION
black setup.py src tests
in your local checkout.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOF
exit 1
fi

# required for isort to order test imports correctly
pip install -Ur test-requirements.txt

if ! isort --check-only --diff . ; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Formatting problems were found (listed above). To fix them, run
pip install isort
isort .
in your local checkout.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOF
exit 1
fi
exit 0
fi

# Actual tests
pip install -Ur test-requirements.txt

pytest -W error -ra -v tests --cov --cov-config=.coveragerc

bash <(curl -s https://codecov.io/bash)
97 changes: 0 additions & 97 deletions ci/travis.sh

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 21 19:11:14 2017.
Expand Down
19 changes: 7 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import io
from setuptools import find_packages, setup

from setuptools import setup, find_packages
exec(open("src/unasync/_version.py", encoding="utf-8").read())

exec(io.open("src/unasync/_version.py", encoding="utf-8").read())

LONG_DESC = io.open("README.rst", encoding="utf-8").read()
LONG_DESC = open("README.rst", encoding="utf-8").read()

setup(
name="unasync",
Expand All @@ -15,27 +13,24 @@
long_description_content_type="text/x-rst",
author="Ratan Kulshreshtha",
author_email="ratan.shreshtha@gmail.com",
license="MIT -or- Apache License 2.0",
license="MIT OR Apache-2.0",
include_package_data=True,
packages=find_packages("src"),
package_dir={"": "src"},
install_requires=[],
keywords=["async"],
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4",
python_requires=">=3.7",
classifiers=[
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Framework :: Trio",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand Down

0 comments on commit 0d21b04

Please sign in to comment.