jrnl/.travis.yml
Micah Jerome Ellison 824aac78cf Add support for Python 3.9 and fix 3.9 build (#1054)
* Support Python 3.9 release in build instead of using 3.9 beta
* Revert Linux and Mac 3.9 definitions since release versions are not working on either
* Run poetry update
* Try out Python 3.10 support on all platforms with allow_failures on
* Adding c:\Python310 path reference for Python 3.10 Windows build
* Clean up unnecessary TOML modification in 3.9 build and always upgrade pyenv in Mac builds
* Clean up unnecessary before_install step on Mac and change 3.9-dev->3.9 definition on Linux
* Reverting Linux Python version to 3.9-dev so that it will run
2020-10-10 17:33:08 -07:00

192 lines
4.6 KiB
YAML

dist: xenial # required for Python >= 3.7
os: linux
language: python
cache:
pip: true
directories:
- $HOME/virtualenv
git:
depth: false
autocrlf: false
before_install:
- date
install:
- pip install --upgrade poetry
- poetry config virtualenvs.in-project true
- poetry config --list
- poetry install
- poetry run python --version
script:
- poetry run pytest
- poetry run behave
aliases:
test_mac: &test_mac
os: osx
language: shell
osx_image: xcode11.2
cache:
directories:
- $HOME/.pyenv/versions
- $HOME/Library/Caches/pypoetry
before_install:
- brew upgrade pyenv
- eval "$(pyenv init -)"
- pyenv install -s $JRNL_PYTHON_VERSION
- pyenv global $JRNL_PYTHON_VERSION
- pip install --upgrade pip
- pip --version
test_windows: &test_windows
os: windows
language: shell
env: &env_windows
PATH: /c/Python37:/c/Python37/Scripts:/c/Python38:/c/Python38/Scripts:/c/Python39:/c/Python39/Scripts:/c/Python310:/c/Python310/Scripts:$PATH
PYTHONIOENCODING: UTF-8
cache:
directories:
- /c/Python37
- /c/Python38
- /c/Python39
- /c/Python310
- /c/ProgramData/chocolatey/lib
- /c/ProgramData/chocolatey/bin
- /c/Users/travis/AppData/Local/pypoetry/Cache
before_install:
- choco install python --version $JRNL_PYTHON_VERSION
- python -m pip install --upgrade pip
- pip --version
jobs:
fast_finish: true
allow_failures:
- name: Python 3.10 on Windows
- name: Python 3.10 on Linux
- name: Python 3.10 on MacOS
- python: nightly
include:
- name: Misc Linting
python: 3.8
script:
- poetry --version
- poetry check
- black --version
- black --check --diff .
- pyflakes --version
- pyflakes .
# Python 3.7 Tests
- name: Python 3.7 on Linux
python: 3.7
- <<: *test_mac
name: Python 3.7 on MacOS
python: 3.7
env:
JRNL_PYTHON_VERSION: 3.7.7
- <<: *test_windows
name: Python 3.7 on Windows
python: 3.7
env:
<<: *env_windows
JRNL_PYTHON_VERSION: 3.7.7
# Python 3.8 Tests
- name: Python 3.8 on Linux
python: 3.8
- <<: *test_mac
name: Python 3.8 on MacOS
python: 3.8
env:
JRNL_PYTHON_VERSION: 3.8.2
- <<: *test_windows
name: Python 3.8 on Windows
python: 3.8
env:
<<: *env_windows
JRNL_PYTHON_VERSION: 3.8.2
# Python 3.9 Tests
- name: Python 3.9 on Linux
python: 3.9-dev
- <<: *test_mac
name: Python 3.9 on MacOS
env:
JRNL_PYTHON_VERSION: 3.9.0
- <<: *test_windows
name: Python 3.9 on Windows
python: 3.9
env:
<<: *env_windows
JRNL_PYTHON_VERSION: 3.9.0
# Python 3.10 Tests
- name: Python 3.10 on Linux
before_install:
- pip install toml
- python .build/allow_all_python_version.py
python: 3.10-dev
- <<: *test_mac
name: Python 3.10 on MacOS
before_install:
- brew upgrade pyenv
- eval "$(pyenv init -)"
- pyenv install -s $JRNL_PYTHON_VERSION
- pyenv global $JRNL_PYTHON_VERSION
- pip install --upgrade pip
- pip --version
- pip install toml
- python .build/allow_all_python_version.py
env:
JRNL_PYTHON_VERSION: 3.10-dev
- <<: *test_windows
name: Python 3.10 on Windows
before_install:
- choco install python --pre
- python --version
- python -m pip install --upgrade pip
- pip --version
- pip install toml
- python .build/allow_all_python_version.py
python: 3.10
env:
<<: *env_windows
JRNL_PYTHON_VERSION: 3.10.0-a1
# ... and beyond!
- name: Python nightly on Linux
before_install:
- python .build/allow_all_python_version.py
python: nightly
# Specialty tests
- name: Python 3.7 on Linux, not UTC
python: 3.7
env:
TZ: America/Edmonton
- stage: Deploy
if: tag IS present
before_deploy:
- poetry build
script:
- echo "Deployment starting..."
deploy:
- provider: script
script: poetry publish
skip_cleanup: true
on:
all_branches: true
# Changelog for Unreleased changes
- stage: Update Changelog
if: (tag IS present) OR (branch = develop AND type NOT IN (pull_request))
install:
- echo 'Skipping installation step'
script:
- ./.build/generate_changelog.sh