diff --git a/.env b/.env index 618f1bf109..3e65e73c32 100644 --- a/.env +++ b/.env @@ -1,7 +1,10 @@ # used by coveralls.io, refs: -# https://coveralls-python.readthedocs.io/en/latest/usage/tox.html#travisci +# https://coveralls-python.readthedocs.io/en/latest/usage/tox.html#github-actions CI -TRAVIS -TRAVIS_BRANCH -TRAVIS_JOB_ID -TRAVIS_PULL_REQUEST +GITHUB_ACTIONS +GITHUB_REF +GITHUB_SHA +GITHUB_HEAD_REF +GITHUB_REPOSITORY +GITHUB_RUN_ID +GITHUB_TOKEN diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000000..b5bb5fbb6c --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,25 @@ +name: PyPI release +on: [push] + +jobs: + pypi_release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.x + uses: actions/setup-python@v2 + with: + python-version: 3.x + - name: Install dependencies + run: | + python -m pip install --upgrade setuptools wheel twine + - name: Build + run: | + python setup.py sdist bdist_wheel + twine check dist/* + - name: Publish package + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.pypi_password }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 997bdec119..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,71 +0,0 @@ -language: generic - -stages: - - unit tests - - build testapps - -services: - - docker - -before_install: - # https://github.com/travis-ci/travis-ci/issues/6069#issuecomment-266546552 - - git remote set-branches --add origin develop - - git fetch - -jobs: - include: - - &unittests - stage: unit tests - language: python - python: 3.7 - before_script: - # We need to escape virtualenv for `test_pythonpackage_basic.test_virtualenv` - # See also: https://github.com/travis-ci/travis-ci/issues/8589 - - type -t deactivate && deactivate || true - - export PATH=/opt/python/3.7.1/bin:$PATH - # Update pip - - python3.7 -m pip install --upgrade pip - # Install tox - - python3.7 -m pip install tox>=2.0 - # Install coveralls & dependencies - # Note: pyOpenSSL needed to send the coveralls reports - - python3.7 -m pip install pyOpenSSL - - python3.7 -m pip install coveralls - script: - # ignores test_pythonpackage.py since it runs for too long - - tox -- tests/ --ignore tests/test_pythonpackage.py - name: "Tox Pep8" - env: TOXENV=pep8 - - <<: *unittests - name: "Tox Python 3 & Coverage" - env: TOXENV=py3 - after_success: - - coveralls - - &testapps - name: Python 3 arm64-v8a (with numpy) - stage: build testapps - before_script: make docker/pull - script: make docker/run/make/testapps-with-numpy/arm64-v8a - - <<: *testapps - name: Python 3 armeabi-v7a - os: osx - osx_image: xcode11 # since xcode1.3, python3 is the default interpreter - before_script: - # installs OpenJDK, Android's SDK/NDK and p4a - - make -f ci/makefiles/osx.mk - script: make testapps/armeabi-v7a - - <<: *testapps - name: Rebuild updated recipes - script: travis_wait 30 make docker/run/make/rebuild_updated_recipes - -# Deploy to PyPI using token set in `PYPI_PASSWORD` environment variable -# https://pypi.org/manage/account/token/ -# https://travis-ci.org/github/kivy/python-for-android/settings -deploy: - provider: pypi - distributions: sdist bdist_wheel - user: "__token__" - on: - tags: true - repo: kivy/python-for-android - python: 3.7 diff --git a/README.md b/README.md index 9af9cc9e15..519e2762fb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ python-for-android ================== -[![Build Status](https://travis-ci.org/kivy/python-for-android.svg?branch=develop)](https://travis-ci.org/kivy/python-for-android) [![Unit tests & build apps](https://github.com/kivy/python-for-android/workflows/Unit%20tests%20&%20build%20apps/badge.svg?branch=develop)](https://github.com/kivy/python-for-android/actions?query=workflow%3A%22Unit+tests+%26+build+apps%22) [![Coverage Status](https://coveralls.io/repos/github/kivy/python-for-android/badge.svg?branch=develop&kill_cache=1)](https://coveralls.io/github/kivy/python-for-android?branch=develop) [![Backers on Open Collective](https://opencollective.com/kivy/backers/badge.svg)](#backers) diff --git a/doc/source/contribute.rst b/doc/source/contribute.rst index 9df08f70ee..c66cd096ea 100644 --- a/doc/source/contribute.rst +++ b/doc/source/contribute.rst @@ -70,9 +70,8 @@ Release checklist :: - [ ] Check that the builds are passing - - [ ] [Travis build](https://travis-ci.org/kivy/python-for-android) - [ ] [GitHub Action](https://github.com/kivy/python-for-android/actions) - - [ ] Run the tests locally via `tox`: this performs some long-running tests that are skipped on Travis. + - [ ] Run the tests locally via `tox`: this performs some long-running tests that are skipped on github-actions. - [ ] Build and run the [on_device_unit_tests](https://github.com/kivy/python-for-android/tree/master/testapps/on_device_unit_tests) app using buildozer. Check that they all pass. - [ ] Build (or download from github actions) and run the following [testapps](https://github.com/kivy/python-for-android/tree/master/testapps/on_device_unit_tests) for arch `armeabi-v7a` and `arm64-v8a`: - [ ] on_device_unit_tests diff --git a/doc/source/docker.rst b/doc/source/docker.rst index 623e0e6883..cba73883bc 100644 --- a/doc/source/docker.rst +++ b/doc/source/docker.rst @@ -9,7 +9,7 @@ using headless VirtualBox and a small distro to run itself on. While this is not the actively supported way to build applications, if you are willing to play with the approach, you can use the ``Dockerfile`` to build -the Docker image we use in ``.travis.yml`` for CI builds and create an Android +the Docker image we use for CI builds and create an Android application with that in a container. This approach allows you to build Android applications on all platforms Docker engine supports. These steps assume you already have Docker preinstalled and set up. diff --git a/pythonforandroid/recipes/matplotlib/__init__.py b/pythonforandroid/recipes/matplotlib/__init__.py index b48a24c6de..2a7d5c37ee 100644 --- a/pythonforandroid/recipes/matplotlib/__init__.py +++ b/pythonforandroid/recipes/matplotlib/__init__.py @@ -120,7 +120,7 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True): # we have the proper package already downloaded, it will use the cached # package to successfully finish the installation. # Note: this may not be necessary for some local systems, but it is - # for our CI providers: `gh-actions` and travis, which will + # for our CI provider: `gh-actions`, which will # fail trying to download the `jquery-ui` package env['XDG_CACHE_HOME'] = join(self.get_build_dir(arch), 'p4a_files') # we make use of the same directory than `XDG_CACHE_HOME`, for our diff --git a/tests/test_pythonpackage.py b/tests/test_pythonpackage.py index a725646e3a..2f88cf2aa4 100644 --- a/tests/test_pythonpackage.py +++ b/tests/test_pythonpackage.py @@ -1,5 +1,5 @@ """ -THESE TESTS DON'T RUN IN TRAVIS (takes too long!!) +THESE TESTS DON'T RUN IN GITHUB-ACTIONS (takes too long!!) ONLY THE BASIC ONES IN test_pythonpackage_basic.py DO. (This file basically covers all tests for any of the diff --git a/tests/test_pythonpackage_basic.py b/tests/test_pythonpackage_basic.py index 9e6596d69e..87f7759df7 100644 --- a/tests/test_pythonpackage_basic.py +++ b/tests/test_pythonpackage_basic.py @@ -1,7 +1,7 @@ """ ONLY BASIC TEST SET. The additional ones are in test_pythonpackage.py. -These are in a separate file because these were picked to run in travis, +These are in a separate file because these were picked to run in github-actions, while the other additional ones aren't (for build time reasons). """ diff --git a/tox.ini b/tox.ini index 76da905c69..223ead06b3 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ deps = # posargs will be replaced by the tox args, so you can override pytest # args e.g. `tox -- tests/test_graph.py` commands = pytest {posargs:tests/} -passenv = TRAVIS TRAVIS_* +passenv = GITHUB_* setenv = PYTHONPATH={toxinidir}