From 7d0cbd81da40d21b2b32316a9f9571dbc8ba62de Mon Sep 17 00:00:00 2001 From: eine Date: Fri, 10 Jan 2020 04:04:09 +0100 Subject: [PATCH 1/3] ci: add 'test' job, rename workflow to 'work.yml' --- .github/workflows/publish.yml | 29 ----------------------- .github/workflows/work.yml | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/work.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index fd5f017..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Publish Python Package - -on: - push: - tags: - - '*' - branches-ignore: - - '!btd/*' - -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 - pip install setuptools wheel twine - - name: Package and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* diff --git a/.github/workflows/work.yml b/.github/workflows/work.yml new file mode 100644 index 0000000..e4efb2e --- /dev/null +++ b/.github/workflows/work.yml @@ -0,0 +1,43 @@ +name: Python Package + +on: + push: + branches-ignore: + - '!btd/*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - run: | + python -m pip install -U pip + python -m pip install -U tox + - run: tox + + deploy: + needs: [test] + if: github.event_name == 'release' && github.event.action == 'created' + 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 -U pip + python -m pip install setuptools wheel twine + - name: Package and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* From 008d2708255b7e439e3c49358ccd49ae274e6370 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 10 Jan 2020 04:17:31 +0100 Subject: [PATCH 2/3] Fixed missed renames. --- btd/sphinx/__init__.py | 4 ++-- btd/sphinx/autoprogram.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/btd/sphinx/__init__.py b/btd/sphinx/__init__.py index ce7beff..5d3b15a 100644 --- a/btd/sphinx/__init__.py +++ b/btd/sphinx/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - sphinxcontrib - ~~~~~~~~~~~~~ + btd.sphinx + ~~~~~~~~~~ This package is a namespace package that contains all extensions distributed in the ``sphinx-contrib`` distribution. diff --git a/btd/sphinx/autoprogram.py b/btd/sphinx/autoprogram.py index 3b0dc65..ee7ac42 100644 --- a/btd/sphinx/autoprogram.py +++ b/btd/sphinx/autoprogram.py @@ -1,6 +1,6 @@ """ - sphinxcontrib.autoprogram - ~~~~~~~~~~~~~~~~~~~~~~~~~ + btd.sphinx.autoprogram + ~~~~~~~~~~~~~~~~~~~~~~ Documenting CLI programs. @@ -493,10 +493,10 @@ def test_make_rst(self): class UtilTestCase(unittest.TestCase): def test_import_object(self): - cls = import_object('sphinxcontrib.autoprogram:UtilTestCase') + cls = import_object('btd.sphinx.autoprogram:UtilTestCase') self.assertTrue(cls is UtilTestCase) instance = import_object( - 'sphinxcontrib.autoprogram:UtilTestCase("test_import_object")' + 'btd.sphinx.autoprogram:UtilTestCase("test_import_object")' ) self.assertIsInstance(instance, UtilTestCase) From 405a4f677908b6f8336b09dd035e1d89283c289c Mon Sep 17 00:00:00 2001 From: eine Date: Fri, 10 Jan 2020 04:24:18 +0100 Subject: [PATCH 3/3] fix lint --- btd/sphinx/autoprogram.py | 1 - 1 file changed, 1 deletion(-) diff --git a/btd/sphinx/autoprogram.py b/btd/sphinx/autoprogram.py index ee7ac42..7a8ad0a 100644 --- a/btd/sphinx/autoprogram.py +++ b/btd/sphinx/autoprogram.py @@ -113,7 +113,6 @@ def format_option(arg): return names, desc - def import_object(import_name): module_name, expr = import_name.split(':', 1) try: