From 2aeff5a2b60b73884073b0628a22adf09f86e19e Mon Sep 17 00:00:00 2001 From: Stefan Schneider Date: Thu, 18 Nov 2021 18:03:03 +0100 Subject: [PATCH] adjust workflows to new setup --- .github/workflows/python-package.yml | 34 ++++++++++++---------------- .github/workflows/python-publish.yml | 14 +++++++----- README.md | 2 +- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index fc456a9..dfff914 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,16 +1,15 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# This workflow runs the build, lints, and tests -name: Python package +name: CI on: push: branches: - main - - dev pull_request: branches: - main - - dev + workflow_dispatch: jobs: build: @@ -19,7 +18,6 @@ jobs: matrix: platform: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.7, 3.8] - poetry-version: [1.1.11] steps: - uses: actions/checkout@v2 @@ -28,20 +26,18 @@ jobs: with: python-version: ${{ matrix.python-version }} - # set up latest version of poetry - - name: Run image - uses: abatilo/actions-poetry@v2.0.0 - with: - poetry-version: ${{ matrix.poetry-version }} - - # install dependencies and project - - name: Install dependencies & project - run: | - poetry install --no-interaction - - - name: Linting & Testing + - name: Install mobile-env and additional dependencies run: | - poetry run flake8 mobile_env --per-file-ignores="__init__.py:F401" - poetry run pytest tests/ + sudo apt update -y + # sudo apt install ffmpeg imagemagick + python -m pip install --upgrade pip + pip install . + pip install -r requirements_tests.txt + - name: Lint with flake8 + run: | + flake8 mobile_env --per-file-ignores="__init__.py:F401" + - name: Run tests with pytest + run: | + pytest diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3b1dd55..1cfb501 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,8 +1,9 @@ -name: Publish +name: PyPI on: release: types: [created] + workflow_dispatch: jobs: deploy: @@ -18,10 +19,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install poetry + pip install setuptools wheel twine - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - poetry version $(git describe --tags --abbrev=0) - poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} - poetry publish --build - + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/README.md b/README.md index 395ebf7..50c8e85 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ The simplest option is to install the latest release of `mobile-env` from PyPI u ```bash pip install mobile-env ``` -This is recommended for most users. +This is recommended for most users. mobile-env is tested on Ubuntu, Windows, and MacOS. ### From Source (Development)