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/* 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..7a8ad0a 100644 --- a/btd/sphinx/autoprogram.py +++ b/btd/sphinx/autoprogram.py @@ -1,6 +1,6 @@ """ - sphinxcontrib.autoprogram - ~~~~~~~~~~~~~~~~~~~~~~~~~ + btd.sphinx.autoprogram + ~~~~~~~~~~~~~~~~~~~~~~ Documenting CLI programs. @@ -113,7 +113,6 @@ def format_option(arg): return names, desc - def import_object(import_name): module_name, expr = import_name.split(':', 1) try: @@ -493,10 +492,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)