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

Fixes #141 - Use a hybrid of Github Actions and TravisCI for testing. #145

Merged
merged 61 commits into from
Apr 5, 2020
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
103ff59
Add initial Github Actions CI config.
freakboy3742 Jan 2, 2020
37efc8d
Add build matrices for xcode and Python.
freakboy3742 Jan 2, 2020
b4bfca0
Try an old version of macOS.
freakboy3742 Jan 2, 2020
5ac1272
Removed xcode version matrix.
freakboy3742 Jan 2, 2020
2683960
Add build status workflow (plus README updates).
freakboy3742 Jan 2, 2020
d317d27
Add publication workflows.
freakboy3742 Jan 2, 2020
f82fc00
Add some extra grace to shutting down the asyncio loop.
freakboy3742 Jan 3, 2020
8f4570f
Minor cleanups of CI config.
freakboy3742 Jan 3, 2020
5115dc5
Add internal how-to on cutting a release.
freakboy3742 Jan 3, 2020
3c32e70
Reintroduce travis config to test against older macOS versions.
freakboy3742 Jan 3, 2020
8b3f81f
Cleaned up and updated docstrings.
freakboy3742 Jan 3, 2020
e43df97
Try building against native Python, rather than pyenv.
freakboy3742 Jan 3, 2020
e4b6d8f
We don't need tox, either.
freakboy3742 Jan 3, 2020
d0cece4
Drop the macOS versions without Python3 support.
freakboy3742 Jan 3, 2020
c64298b
Merge branch 'master' into native-python
freakboy3742 Jan 4, 2020
880365b
Re-introduce pyenv, but use the natively available version.
freakboy3742 Jan 4, 2020
c61f14e
Simplified workflows to remove duplication.
freakboy3742 Jan 4, 2020
0f6063d
Invoke pip etc as a module.
freakboy3742 Jan 4, 2020
058dacb
Remove reference to Tox in CI build.
freakboy3742 Jan 4, 2020
8770397
Added corrections and clarifications to release procedures.
freakboy3742 Jan 4, 2020
571289c
Corrected YAML for Github workflow trigger.
freakboy3742 Jan 4, 2020
05fbb90
Make sure DYLD_LIBRARY_PATH is set.
freakboy3742 Jan 4, 2020
ada1888
Added a twine check to the end of the CI build.
freakboy3742 Jan 4, 2020
ac8159d
Tweak the travis build invocation again...
freakboy3742 Jan 4, 2020
1e86593
Don't need tox, do need the project code.
freakboy3742 Jan 4, 2020
98a9837
Improved debug when test harness fails.
freakboy3742 Jan 4, 2020
f20a0a3
Added human name to packaging step.
freakboy3742 Jan 4, 2020
51b0efe
wave fist at Travis...
freakboy3742 Jan 4, 2020
cb2d336
Lets try again...
freakboy3742 Jan 4, 2020
8247bd2
Add some debug info...
freakboy3742 Jan 4, 2020
0e7c50a
Could it be this simple...?
freakboy3742 Jan 4, 2020
96dea60
I give up. Tox seems to set it.
freakboy3742 Jan 4, 2020
1eda65a
More debugging...
freakboy3742 Jan 4, 2020
e819aa0
Yet more debug...
freakboy3742 Jan 4, 2020
aa37dd6
Does anything set an environment variable?
freakboy3742 Jan 4, 2020
0b4cd53
More debugging.
freakboy3742 Jan 4, 2020
fb243de
Is DYLD_LIBRARY_PATH special?
freakboy3742 Jan 4, 2020
023895d
Hackity hack hack.
freakboy3742 Jan 4, 2020
76d8a0b
Corrected some README links.
freakboy3742 Jan 4, 2020
930de73
Ordered the macOS releases.
freakboy3742 Jan 4, 2020
47aa29b
Clarify why DYLD_LIBRARY_PATH is a problem.
freakboy3742 Jan 4, 2020
fe63f7e
Try using a local alias, rather than the global.
freakboy3742 Jan 4, 2020
547bd96
pyenv local is apparently safe from SIP.
freakboy3742 Jan 4, 2020
d3d9a40
Cleaned up some debug.
freakboy3742 Jan 4, 2020
9c69e3e
Save, *then* commit.
freakboy3742 Jan 4, 2020
c495141
Ok... this is weird...
freakboy3742 Jan 4, 2020
cb60932
Dig into where the shim is located.
freakboy3742 Jan 4, 2020
4a921c0
Restore the subprocess hack.
freakboy3742 Jan 4, 2020
2c0f263
Try being explicit about the pyenv Python version that is running.
freakboy3742 Jan 4, 2020
681a0f8
Clean up explanation of pyenv workaround.
freakboy3742 Jan 5, 2020
5222c41
If you want to use SSH URLs, you'll know how to set them up.
freakboy3742 Jan 5, 2020
265779a
More clarifications on the release process.
freakboy3742 Jan 5, 2020
a49a260
Clarified an error message.
freakboy3742 Jan 11, 2020
e8bbc8b
Reverted a string formatting change for patch clarity.
freakboy3742 Jan 11, 2020
5e62fc7
I are an english speaker.
freakboy3742 Jan 11, 2020
b09bb28
Use HTTPS links.
freakboy3742 Jan 11, 2020
51a58b8
Normalize invocation of make.
freakboy3742 Jan 11, 2020
bf6c94e
Add Python 3.8 to the tox configuration.
freakboy3742 Jan 11, 2020
c3c9407
Make sure beefore step will be able to run outside of PRs.
freakboy3742 Jan 11, 2020
6b8705c
Merge branch 'master' into native-python
dgelessus Apr 5, 2020
5ebfa68
Merge remote-tracking branch 'origin/master' into native-python
freakboy3742 Apr 5, 2020
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
99 changes: 99 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: CI
on:
pull_request:
push:
branches:
- master

jobs:
beefore:
name: Pre-test checks
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
task: ['pycodestyle']
dgelessus marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install beefore
- name: Run Beefore checks
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -z "${{ github.event.number }}" ]; then
beefore ${{ matrix.task }} .
else
beefore --username github-actions --repository ${{ github.repository }} --pull-request ${{ github.event.number }} --commit ${{ github.event.pull_request.head.sha }} ${{ matrix.task }} .
fi

smoke:
name: Smoke test (3.5)
needs: beefore
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.5
uses: actions/setup-python@v1
with:
python-version: 3.5
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .
- name: Build test library
run: |
make
- name: Test
run: |
DYLD_LIBRARY_PATH=tests/objc python setup.py test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting the output of python setup.py test:

WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.

So it's probably best to use tox to call the tests, rather than python setup.py test.

Our current tox configuration also uses python setup.py test, so we need to change that at some point too, but not necessarily in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I've been (slowly) coming around on pytest... so maybe this is the trigger to make that change.


python-versions:
name: Python compatibility test
needs: smoke
runs-on: macOS-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .
- name: Build test library
run: |
make
- name: Test
run: |
DYLD_LIBRARY_PATH=tests/objc python setup.py test

package:
name: Packaging checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel twine
- name: Build and check release artefacts
run: |
python setup.py sdist bdist_wheel
python -m twine check dist/*
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Upload Python Package

on:
release:
types: published

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m twine check dist/*
python -m twine upload dist/*
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Create Release

on:
push:
tags:
- 'v*'

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
66 changes: 25 additions & 41 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,42 @@ branches:
os: osx
matrix:
include:
# Note: The ordering of the environments is optimized so that the complete matrix runs as quickly as possible,
# while also providing the first results as early as possible.
dgelessus marked this conversation as resolved.
Show resolved Hide resolved
# At the moment, build times for each environment are roughly as follows:
# xcode7.3: 16 minutes
# xcode8.3: 7 minutes
# xcode9.2: 7 minutes
# xcode10.1: 6 minutes
# https://docs.travis-ci.com/user/reference/osx/#macos-version
# This data is based on the following build, which should be similar to most builds on the repo:
# https://travis-ci.org/pybee/rubicon-objc/builds/506412489
# Currently, Travis allows a maximum of two concurrent Mac builds per owner:
# https://blog.travis-ci.com/2017-09-22-macos-update
# With the following order, xcode7.3 will take up the first slot, and at the same time the three other
# environments use the second slot in sequence. xcode10.1 will finish first and provide some early results - most
# test failures happen in all environments and will be quickly reported this way.

# OSX 10.11 El Capitan
- osx_image: xcode7.3
# macOS 10.12 Sierra
- osx_image: xcode8.3
dgelessus marked this conversation as resolved.
Show resolved Hide resolved
- osx_image: xcode9.2
# macOS 10.13 High Sierra
- osx_image: xcode10.1
# macOS 10.14 Mojave
- osx_image: xcode10.2
# macOS 10.12 Sierra
- osx_image: xcode9.2
- osx_image: xcode8.3
language: generic
cache:
directories:
~/.pyenv
env:
global:
- PY35="3.5.6"
- PY36="3.6.8"
- PY37="3.7.2"
install:
# The different Travis environments have different pyenv versions, and not all have the Python versions we need,
# so we upgrade pyenv to get a consistent setup in all environments.
- brew update
- brew outdated pyenv || brew upgrade pyenv
# The existing pyenv shims from the build cache may no longer be valid, for example if pyenv was upgraded
# (in which case the paths used in the shims point to an older, no longer installed pyenv version).
# By rehashing the shims we can be sure that they are always valid again.
- pyenv rehash
# pyenv's shims directory is not in the PATH by default.
- export PATH="$(pyenv root)/shims:${PATH}"
# These are the Python versions that we want to test on.
- pyenv install --skip-existing ${PY35}
- pyenv install --skip-existing ${PY36}
- pyenv install --skip-existing ${PY37}
- pyenv global ${PY37} ${PY36} ${PY35} system
dgelessus marked this conversation as resolved.
Show resolved Hide resolved
- pip install --upgrade tox
- make -f Makefile
# Diagnostic: Find out which versions of Python are availalbe.
- pyenv install -l
dgelessus marked this conversation as resolved.
Show resolved Hide resolved
# Rubicon supports Python 3.5 and newer.
# The most recent version of Python 3.5 provided by the pyenv install on
# macOS 10.11 is 3.5.2. There are more recent versions of Python 3.5
# available, but using them would mean updating pyenv, which takes 10+
# minutes on macOS 10.11.
- pyenv install --skip-existing 3.5.2
- pyenv global 3.5.2
- python -m pip install --upgrade pip setuptools
- python -m pip install .
script:
- export DYLD_LIBRARY_PATH=`pwd`/tests/objc
- tox -e "py{35,36,37},flake8"
- make
# This next line *should* be:
# DYLD_LIBRARY_PATH=tests/objc python setup.py test
# but the way Travis invokes Python through pyenv triggers macOS's System
# Integrity Protection (SIP) (see https://apple.stackexchange.com/a/216815).
# As a result, DYLD_LIBRARY_PATH isn't exposed to the Python process.
# Calling `$(pyenv which python)` instead of `python` uses a direct version
# of the python executable rather than the pyenv shims (which take a
# circuitous route performing multiple exec calls through various /usr/local
# locations). This avoids triggering SIP, so DYLD_LIBRARY_PATH is exposed.
- DYLD_LIBRARY_PATH=tests/objc "$(pyenv which python)" setup.py test
38 changes: 22 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@ Rubicon-ObjC
============

.. image:: https://img.shields.io/pypi/pyversions/rubicon-objc.svg
:target: https://pypi.python.org/pypi/rubicon-objc
:target: https://pypi.python.org/pypi/rubicon-objc
:alt: Python Versions

.. image:: https://img.shields.io/pypi/v/rubicon-objc.svg
:target: https://pypi.python.org/pypi/rubicon-objc
:target: https://pypi.python.org/pypi/rubicon-objc
:alt: Project Version

.. image:: https://img.shields.io/pypi/status/rubicon-objc.svg
:target: https://pypi.python.org/pypi/rubicon-objc
:target: https://pypi.python.org/pypi/rubicon-objc
:alt: Project status

.. image:: https://img.shields.io/pypi/l/rubicon-objc.svg
:target: https://github.com/pybee/rubicon-objc/blob/master/LICENSE
:target: https://github.com/beeware/rubicon-objc/blob/master/LICENSE
:alt: License

.. image:: https://travis-ci.org/pybee/rubicon-objc.svg?branch=master
:target: https://travis-ci.org/pybee/rubicon-objc
.. image:: https://github.com/beeware/rubicon-objc/workflows/CI/badge.svg?branch=master
:target: https://github.com/beeware/rubicon-objc/actions
:alt: Build Status

.. image:: https://badges.gitter.im/pybee/general.svg
:target: https://gitter.im/pybee/general
.. image:: https://badges.gitter.im/beeware/general.svg
:target: https://gitter.im/beeware/general
:alt: Gitter chat room

Rubicon-ObjC is a bridge between Objective-C and Python. It enables you to:

Expand Down Expand Up @@ -66,7 +72,7 @@ Rubicon is part of the `BeeWare suite`_. You can talk to the community through:

* `@pybeeware on Twitter`_

* The `pybee/general`_ channel on Gitter.
* The `beeware/general`_ channel on Gitter.

Code of Conduct
---------------
Expand All @@ -84,11 +90,11 @@ Contributing
If you experience problems with this backend, `log them on GitHub`_. If you
want to contribute code, please `fork the code`_ and `submit a pull request`_.

.. _BeeWare suite: http://pybee.org
.. _Read The Docs: http://rubicon-objc.readthedocs.org
.. _BeeWare suite: https://beeware.org
.. _Read The Docs: https://rubicon-objc.readthedocs.org
.. _@pybeeware on Twitter: https://twitter.com/pybeeware
.. _pybee/general: https://gitter.im/pybee/general
.. _Code of Conduct: http://pybee.org/community/behavior/
.. _log them on GitHub: https://github.com/pybee/rubicon-objc/issues
.. _fork the code: https://github.com/pybee/rubicon-objc
.. _submit a pull request: https://github.com/pybee/rubicon-objc/pulls
.. _beeware/general: https://gitter.im/beeware/general
.. _Code of Conduct: https://beeware.org/community/behavior/
.. _log them on GitHub: https://github.com/beeware/rubicon-objc/issues
.. _fork the code: https://github.com/beeware/rubicon-objc
.. _submit a pull request: https://github.com/beeware/rubicon-objc/pulls
3 changes: 2 additions & 1 deletion docs/how-to/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ already knows than tutorials do, and unlike documents in the tutorial they can
stand alone.

.. toctree::
:maxdepth: 1
:maxdepth: 2
:glob:

Get started <get-started>
Expand All @@ -19,3 +19,4 @@ stand alone.
async
contribute-code
contribute-docs
internal/index
12 changes: 12 additions & 0 deletions docs/how-to/internal/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
======================
Internal How-to guides
======================

These guides are for the maintainers of the Rubicon-ObjC project, documenting
internal project procedures.

.. toctree::
:maxdepth: 2
:glob:

release
Loading