Skip to content

ci: add 'test' job, rename workflow to 'work.yml' #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: btd/master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/publish.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/work.yml
Original file line number Diff line number Diff line change
@@ -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/*
4 changes: 2 additions & 2 deletions btd/sphinx/__init__.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
9 changes: 4 additions & 5 deletions btd/sphinx/autoprogram.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
sphinxcontrib.autoprogram
~~~~~~~~~~~~~~~~~~~~~~~~~
btd.sphinx.autoprogram
~~~~~~~~~~~~~~~~~~~~~~

Documenting CLI programs.

Expand Down Expand Up @@ -113,7 +113,6 @@ def format_option(arg):
return names, desc



def import_object(import_name):
module_name, expr = import_name.split(':', 1)
try:
Expand Down Expand Up @@ -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)

Expand Down