]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Replace Travis + Appveyor with GitHub Actions (WIP) 754/head
authorAarni Koskela <akx@iki.fi>
Tue, 10 Nov 2020 14:19:04 +0000 (16:19 +0200)
committerAarni Koskela <akx@iki.fi>
Thu, 12 Nov 2020 09:42:54 +0000 (11:42 +0200)
.ci/appveyor.yml [deleted file]
.ci/deploy.linux.sh [deleted file]
.ci/deploy.osx.sh [deleted file]
.ci/deps.linux.sh [deleted file]
.ci/deps.osx.sh [deleted file]
.ci/run_with_env.cmd [deleted file]
.github/workflows/test.yml [new file with mode: 0644]
.travis.yml [deleted file]
setup.py
tox.ini

diff --git a/.ci/appveyor.yml b/.ci/appveyor.yml
deleted file mode 100644 (file)
index 91758f4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# From https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
-
-environment:
-  global:
-    # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
-    # /E:ON and /V:ON options are not enabled in the batch script intepreter
-    # See: https://stackoverflow.com/a/13751649
-    CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\.ci\\run_with_env.cmd"
-
-  matrix:
-    - PYTHON: "C:\\Python35"
-      PYTHON_VERSION: "3.5.x"
-      PYTHON_ARCH: "32"
-
-    - PYTHON: "C:\\Python35-x64"
-      PYTHON_VERSION: "3.5.x"
-      PYTHON_ARCH: "64"
-
-branches:  # Only build official branches, PRs are built anyway.
-  only:
-    - master
-    - /release.*/
-
-install:
-  - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
-  # Check that we have the expected version and architecture for Python
-  - "python --version"
-  - "python -c \"import struct; print(struct.calcsize('P') * 8)\""
-  # Build data files
-  - "pip install --upgrade pytest==4.3.1 pytest-cov==2.6.1 codecov freezegun==0.3.12"
-  - "pip install --editable ."
-  - "python setup.py import_cldr"
-
-build: false  # Not a C# project, build stuff at the test step instead.
-
-test_script:
-  - "%CMD_IN_ENV% python -m pytest --cov=babel"
-  - "codecov"
diff --git a/.ci/deploy.linux.sh b/.ci/deploy.linux.sh
deleted file mode 100644 (file)
index 4d59382..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-set -x
-set -e
-
-bash <(curl -s https://codecov.io/bash)
diff --git a/.ci/deploy.osx.sh b/.ci/deploy.osx.sh
deleted file mode 100644 (file)
index c44550e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-set -x
-set -e
-
-echo "Due to a bug in codecov, coverage cannot be deployed for Mac builds."
diff --git a/.ci/deps.linux.sh b/.ci/deps.linux.sh
deleted file mode 100644 (file)
index 13cc9e1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-set -x
-set -e
-
-echo "No dependencies to install for linux."
diff --git a/.ci/deps.osx.sh b/.ci/deps.osx.sh
deleted file mode 100644 (file)
index b52a84f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-set -e
-set -x
-
-# Install packages with brew
-brew update >/dev/null
-brew outdated pyenv || brew upgrade --quiet pyenv
-
-# Install required python version for this build
-pyenv install -ks $PYTHON_VERSION
-pyenv global $PYTHON_VERSION
-python --version
diff --git a/.ci/run_with_env.cmd b/.ci/run_with_env.cmd
deleted file mode 100644 (file)
index 0f5b8e0..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-:: To build extensions for 64 bit Python 3, we need to configure environment
-:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
-:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
-::
-:: To build extensions for 64 bit Python 2, we need to configure environment
-:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
-:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
-::
-:: 32 bit builds do not require specific environment configurations.
-::
-:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
-:: cmd interpreter, at least for (SDK v7.0)
-::
-:: More details at:
-:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
-:: https://stackoverflow.com/a/13751649
-::
-:: Author: Olivier Grisel
-:: License: CC0 1.0 Universal: https://creativecommons.org/publicdomain/zero/1.0/
-@ECHO OFF
-
-SET COMMAND_TO_RUN=%*
-SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
-
-SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
-IF %MAJOR_PYTHON_VERSION% == "2" (
-    SET WINDOWS_SDK_VERSION="v7.0"
-) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
-    SET WINDOWS_SDK_VERSION="v7.1"
-) ELSE (
-    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
-    EXIT 1
-)
-
-IF "%PYTHON_ARCH%"=="64" (
-    ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
-    SET DISTUTILS_USE_SDK=1
-    SET MSSdk=1
-    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
-    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
-    ECHO Executing: %COMMAND_TO_RUN%
-    call %COMMAND_TO_RUN% || EXIT 1
-) ELSE (
-    ECHO Using default MSVC build environment for 32 bit architecture
-    ECHO Executing: %COMMAND_TO_RUN%
-    call %COMMAND_TO_RUN% || EXIT 1
-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644 (file)
index 0000000..e9c4118
--- /dev/null
@@ -0,0 +1,38 @@
+name: Test
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  test:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-18.04, windows-2019, macos-10.15]
+        python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
+        exclude:
+          - os: windows-2019
+            python-version: pypy3
+            # TODO: Remove this; see:
+            #       https://github.com/actions/setup-python/issues/151
+            #       https://github.com/tox-dev/tox/issues/1704
+            #       https://foss.heptapod.net/pypy/pypy/-/issues/3331
+    env:
+      BABEL_CLDR_NO_DOWNLOAD_PROGRESS: "1"
+      BABEL_CLDR_QUIET: "1"
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip setuptools wheel
+        python -m pip install tox tox-gh-actions==2.1.0
+    - name: Run test via Tox
+      run: tox --skip-missing-interpreters
+    - uses: codecov/codecov-action@v1
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 1bebe7f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-dist: xenial
-language: python
-
-cache:
-  directories:
-  - cldr
-  - "$HOME/.cache/pip"
-  - "$HOME/.pyenv"
-
-matrix:
-  include:
-    - os: linux
-      python: 2.7
-      env:
-      - PYTEST_VERSION=4.3.1
-    - os: linux
-      python: 2.7
-      env:
-      - CDECIMAL=m3-cdecimal
-      - PYTEST_VERSION=4.3.1
-    - os: linux
-      dist: trusty
-      python: pypy
-      env:
-      - PYTEST_VERSION=4.3.1
-    - os: linux
-      dist: trusty
-      python: pypy3
-      env:
-      - PYTEST_VERSION=6.1.2
-    - os: linux
-      python: 3.4
-      env:
-      - PYTEST_VERSION=4.3.1
-    - os: linux
-      python: 3.5
-      env:
-      - PYTHON_TEST_FLAGS=-bb
-      - PYTEST_VERSION=6.1.2
-    - os: linux
-      python: 3.6
-      env:
-      - PYTEST_VERSION=6.1.2
-    - os: linux
-      python: 3.7
-      env:
-      - PYTEST_VERSION=6.1.2
-    - os: linux
-      python: 3.8
-      env:
-      - PYTEST_VERSION=6.1.2
-    - os: linux
-      python: 3.9
-      env:
-      - PYTEST_VERSION=6.1.2
-install:
-  - bash .ci/deps.${TRAVIS_OS_NAME}.sh
-  - pip install --upgrade pip
-  - pip install --upgrade $CDECIMAL pytest==$PYTEST_VERSION pytest-cov freezegun==0.3.12 'backports.zoneinfo;python_version>="3.6" and python_version<"3.9"'
-  - pip install --editable .
-
-script:
-  - make test-cov
-  - bash .ci/deploy.${TRAVIS_OS_NAME}.sh
-
-notifications:
-  email: false
-  irc:
-    channels:
-      - "chat.freenode.net#pocoo"
-    on_success: change
-    on_failure: always
-    use_notice: true
-    skip_join: true
index 0032a3a056138e9ce9472b678659857a664f4f31..adf3bb5d914ad01943d62b9673c215afd6012688 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -44,18 +44,16 @@ setup(
         'License :: OSI Approved :: BSD License',
         'Operating System :: OS Independent',
         'Programming Language :: Python',
-        'Programming Language :: Python :: 2',
-        'Programming Language :: Python :: 2.7',
         'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.4',
-        '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 :: Implementation :: CPython',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Topic :: Software Development :: Libraries :: Python Modules',
     ],
-    python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
+    python_requires='>=3.6',
     packages=['babel', 'babel.messages', 'babel.localtime'],
     include_package_data=True,
     install_requires=[
diff --git a/tox.ini b/tox.ini
index 27faf5bbbca7cd203484ef1421ec005a59e4e896..14b450ff8c3e63826054c214146384824cadf562 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,20 +1,25 @@
 [tox]
-envlist = py27, pypy, py34, py35, py36, py37, pypy3, py27-cdecimal
+envlist =
+    py{36,37,38,39}
+    pypy3
 
 [testenv]
 deps =
-    pytest==4.3.1;python_version<"3.5"
-    pytest==6.1.2;python_version>="3.5"
+    pytest
     pytest-cov
-    cdecimal: m3-cdecimal
     freezegun==0.3.12
-    backports.zoneinfo;python_version>"3.6" and python_version<"3.9"
+    backports.zoneinfo;python_version<"3.9"
+    tzdata;sys_platform == 'win32'
 whitelist_externals = make
-commands = make clean-cldr test
-passenv = PYTHON_TEST_FLAGS
+commands = make clean-cldr test-cov
+passenv =
+    BABEL_*
+    PYTHON_*
 
-[pep8]
-ignore = E501,E731,W503
-
-[flake8]
-ignore = E501,E731,W503
+[gh-actions]
+python =
+    pypy3: pypy3
+    3.6: py36
+    3.7: py37
+    3.8: py38
+    3.9: py39