Skip to content

Commit

Permalink
Travis CI migration and packaging improvements (aio-libs#2990)
Browse files Browse the repository at this point in the history
* Opt-in to use edge Travis CI config parser

* Drop outdated comment from Travis CI config

* Turn env vars in Travis CI config to key-value

* Move towncrier linter into its own job

* Upgrade refs across repo to point to travis-ci.com

* Make run_docker script saver to maintain

* Announce support for Python 3.7

* Use pytest-runner in dist setup

* Don't install mypy under PyPy

* Don't install uvloop under 3.7

* Run pytest directly in AppVeyor CI
  • Loading branch information
webknjaz authored and asvetlov committed May 17, 2018
1 parent 3b0cb5b commit 1d3afb2
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ install:
build: false

test_script:
- "tools/build.cmd %PYTHON%\\python.exe setup.py test"
- "tools/build.cmd %PYTHON%\\python.exe -m pytest tests"

after_test:
- "tools/build.cmd %PYTHON%\\python.exe setup.py sdist bdist_wheel"
Expand Down
19 changes: 12 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: "= 0"

sudo: false

language: python
Expand Down Expand Up @@ -123,8 +125,6 @@ _helpers:
- *env_pyenv
- *env_path

# doesn't work on MacOSX out of the box -- the system has no Python installed
# there's a workaround to use `language: generic` and install it, but it's slow
os: linux

jobs:
Expand All @@ -136,20 +136,25 @@ jobs:
include:
- <<: *_doc_base
env:
- docs
- TARGET=docs
script:
- towncrier --yes
- make doc-spelling

- <<: *_doc_base
env:
- TARGET=towncrier
script:
- towncrier --yes

- <<: *_lint_base
env:
- flake8
- TARGET=flake8
script:
- flake8 aiohttp examples tests

- <<: *_lint_base
env:
- dist setup check
- TARGET="dist setup check"
install:
- *upgrade_python_toolset
- pip install -r requirements/doc.txt
Expand Down Expand Up @@ -185,7 +190,7 @@ jobs:
# Build and deploy manylinux1 binary wheels and source distribution
- <<: *generic_deploy_base
<<: *_reset_steps
env: Build and deploy to PYPI of manylinux1 binary wheels for all supported Pythons and source distribution
env: Build and deploy to PYPI of manylinux1 binary wheels for all supported Pythons and source distribution=
dist: trusty
group: edge
services:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Async http client/server framework

|
.. image:: https://travis-ci.org/aio-libs/aiohttp.svg?branch=master
:target: https://travis-ci.org/aio-libs/aiohttp
.. image:: https://travis-ci.com/aio-libs/aiohttp.svg?branch=master
:target: https://travis-ci.com/aio-libs/aiohttp
:align: right
:alt: Travis status for master branch

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@
'github_button': True,
'github_type': 'star',
'github_banner': True,
'badges': [{'image': 'https://secure.travis-ci.org/aio-libs/aiohttp.svg?branch=master',
'target': 'https://travis-ci.org/aio-libs/aiohttp',
'badges': [{'image': 'https://travis-ci.com/aio-libs/aiohttp.svg?branch=master',
'target': 'https://travis-ci.com/aio-libs/aiohttp',
'height': '20',
'alt': 'Travis CI status'},
{'image': 'https://codecov.io/github/aio-libs/aiohttp/coverage.svg?branch=master',
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Please feel free to file an issue on the `bug tracker
<https://github.com/aio-libs/aiohttp/issues>`_ if you have found a bug
or have some suggestion in order to improve the library.

The library uses `Travis <https://travis-ci.org/aio-libs/aiohttp>`_ for
The library uses `Travis <https://travis-ci.com/aio-libs/aiohttp>`_ for
Continuous Integration.


Expand Down
2 changes: 1 addition & 1 deletion requirements/ci-wheel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ yarl==1.2.4
# Using PEP 508 env markers to control dependency on runtimes:
aiodns==1.1.1; platform_system!="Windows" # required c-ares will not build on windows
codecov==2.0.15; platform_system!="Windows" # We only use it in Travis CI
uvloop==0.9.1; platform_system!="Windows" and implementation_name=="cpython" # MagicStack/uvloop#14
uvloop==0.9.1; platform_system!="Windows" and implementation_name=="cpython" and python_version<"3.7" # MagicStack/uvloop#14
idna-ssl==1.0.1; python_version<"3.7"
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
setuptools-git==1.2
mypy==0.600
mypy==0.600; implementation_name=="cpython"

-r doc.txt
-r ci-wheel.txt
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[aliases]
test = pytest

[metadata]
license_file = LICENSE.txt

Expand Down
34 changes: 20 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
DistutilsPlatformError)

from setuptools import Extension, setup
from setuptools.command.test import test as TestCommand


if sys.version_info < (3, 5, 3):
Expand Down Expand Up @@ -85,17 +84,11 @@ def read(f):
return (here / f).read_text('utf-8').strip()


class PyTest(TestCommand):
user_options = []
NEEDS_PYTEST = {'pytest', 'test'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if NEEDS_PYTEST else []

def run(self):
import subprocess
errno = subprocess.call([sys.executable, '-m', 'pytest', 'tests'])
raise SystemExit(errno)


tests_require = install_requires + ['pytest', 'gunicorn',
'pytest-timeout', 'async-generator']
tests_require = ['pytest', 'gunicorn',
'pytest-timeout', 'async-generator']


args = dict(
Expand All @@ -110,6 +103,7 @@ def run(self):
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Development Status :: 5 - Production/Stable',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
Expand All @@ -122,16 +116,28 @@ def run(self):
maintainer=', '.join(('Nikolay Kim <[email protected]>',
'Andrew Svetlov <[email protected]>')),
maintainer_email='[email protected]',
url='https://github.com/aio-libs/aiohttp/',
url='https://github.com/aio-libs/aiohttp',
project_urls={
'Chat: Gitter': 'https://gitter.im/aio-libs/Lobby',
'CI: AppVeyor': 'https://ci.appveyor.com/project/asvetlov/aiohttp', # FIXME: move under aio-libs/* slug
'CI: Circle': 'https://circleci.com/gh/aio-libs/aiohttp',
'CI: Shippable': 'https://app.shippable.com/github/aio-libs/aiohttp',
'CI: Travis': 'https://travis-ci.com/aio-libs/aiohttp',
'Coverage: codecov': 'https://codecov.io/github/aio-libs/aiohttp',
'Docs: RTD': 'https://docs.aiohttp.org',
'GitHub: issues': 'https://github.com/aio-libs/aiohttp/issues',
'GitHub: repo': 'https://github.com/aio-libs/aiohttp',
},
license='Apache 2',
packages=['aiohttp'],
python_requires='>=3.5.3',
install_requires=install_requires,
tests_require=tests_require,
setup_requires=pytest_runner,
include_package_data=True,
ext_modules=extensions,
cmdclass=dict(build_ext=ve_build_ext,
test=PyTest))
cmdclass=dict(build_ext=ve_build_ext),
)

try:
setup(**args)
Expand Down
5 changes: 4 additions & 1 deletion tools/run_docker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
set -e

set -euo pipefail

package_name="$1"
if [ -z "$package_name" ]
Expand Down Expand Up @@ -35,3 +36,5 @@ do

dock_ext_args="" # Reset docker args, just in case
done

set +u

0 comments on commit 1d3afb2

Please sign in to comment.