Skip to content
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
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upload Python Package

on:
release:
types: published

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools twine wheel
- name: Build release artifacts
run: |
python setup.py sdist bdist_wheel
python -m twine check dist/*
- name: Publish release
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m twine upload dist/*
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Create Release

on:
push:
tags:
- '*'

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
77 changes: 77 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Linux tests

on:
push:
branches:
- master
paths:
- '.github/workflows/*.yml'
- 'requirements/*.txt'
- 'Makefile'
- 'MANIFEST.in'
- '**.bat'
- '**.py'
- '**.sh'

pull_request:
branches:
- master
paths:
- '.github/workflows/*.yml'
- 'requirements/*.txt'
- 'MANIFEST.in'
- '**.bat'
- '**.py'
- '**.sh'

jobs:
############################################################################
# Close previous builds on the same branch
############################################################################
cleanup-previous-runs:
name: Cleanup previous builds
runs-on: ubuntu-latest
steps:
- run: echo $GITHUB_EVENT_NAME
- uses: rokroskar/[email protected]
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

############################################################################
# Python tests
############################################################################
linux-py:
name: Linux py${{ matrix.PYTHON_VERSION }} tests
runs-on: ubuntu-latest
needs: cleanup-previous-runs
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.6', '3.7', '3.8']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py-${{ matrix.PYTHON_VERSION }}-pip-${{ hashFiles('**/setup.py') }}
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install python dependencies
run: |
python -m pip install --upgrade check-manifest codecov pip pre-commit setuptools
python -m pip install --editable .
- name: Show python environment
run: |
python --version
python -m pip list
- name: Run pre-commit checks
run: |
pre-commit run -a
11 changes: 0 additions & 11 deletions .gitlab-ci.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .gitlabci/download_python_environment_manager.sh

This file was deleted.

13 changes: 0 additions & 13 deletions .gitlabci/mock_vagrant.sh

This file was deleted.

17 changes: 3 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
repos:
- repo: https://github.com/ambv/black
rev: 19.3b0
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.7.0
rev: v2.3.0
hooks:
- id: reorder-python-imports
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
rev: 3.8.2
hooks:
- id: flake8
args: ["--config=setup.cfg"]
language_version: python3
additional_dependencies: [
flake8-2020, # flake8 plugin which checks for misuse of `sys.version` or `sys.version_info`
flake8-blind-except, # A flake8 extension that checks for blind except: statements
flake8-bugbear, # A plugin for flake8 finding likely bugs and design problems in your program.
# # Contains warnings that don't belong in pyflakes and pycodestyle.
flake8-builtins, # Check for python builtins being used as variables or parameters.
flake8-comprehensions, # It helps you write a better list/set/dict comprehensions.
flake8-copyright, # Adds copyright checks to flake8
flake8-deprecated, # Warns about deprecated method calls.
dlint, # Dlint is a tool for encouraging best coding practices and helping ensure we're writing secure Python code.
# flake8-docstrings, # Extension for flake8 which uses pydocstyle to check docstrings
flake8-eradicate, # Flake8 plugin to find commented out code
flake8-license,
# pandas-vet, # A Flake8 plugin that provides opinionated linting for pandas code
flake8-pytest, # pytest assert checker plugin for flake8
flake8-variables-names, # flake8 extension that helps to make more readable variables names
pep8-naming, # Check PEP-8 naming conventions, plugin for flake8
]
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Changelog

## 0.1.4 TBD

First Changelog entry. As of this entry many commands are supported, including ones that use stdin.
Known limitations: Windows, dynamic displays.
34 changes: 0 additions & 34 deletions Makefile

This file was deleted.

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# README
[![PyPI version](https://badge.fury.io/py/CLI-passthrough.svg)](https://pypi.org/project/CLI-passthrough/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/CLI-passthrough.svg)](https://pypi.org/project/CLI-passthrough/)
[![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)


## Install

Expand Down
37 changes: 37 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Release

* Update [CHANGELOG.md](https://github.com/terminal-labs/cli-passthrough/blob/master/CHANGELOG.md)

* Update package version on [setup.py](https://github.com/terminal-labs/cli-passthrough/blob/master/setup.py)

* Commit changes
```bash
git add .
git commit -m "Prepare release version"
```

* Tag the release
```bash
git tag vX.X.X
```

* Push changes
```bash
git push origin master
git push origin --tags
```

* The new tag will trigger a Github action workflow on CI and will create a [pre-release](https://github.com/terminal-labs/cli-passthrough/releases).

* Once that release is moved from pre-release to release another Github Action will publish to PyPI using the `nixjdm` account.

## Retrigger events

If the release process needs to be fixed or retriggered you will need to delete the tag and recreate it, or create a new tag from scratch.

* To delete and recreate a tag:
```bash
git push --delete origin refs/tags/<tag-name>
git tag <recreated-tag-name>
git push origin --tags
```
16 changes: 0 additions & 16 deletions dependencies/apt.txt

This file was deleted.

7 changes: 2 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[bdist_wheel]
universal=1

[flake8]
exclude=wsgi.py,env/*,*/migrations/*,venv/*,.env/*,.venv/*,local_settings.py,doc/*,*/node_modules/*
# ignore=E203,F403,E128,E126,E123,E121,E265,E501,N802,N803,N806,C901,D100,D102,D102,D10,W503,E731,E402
max-line-length = 88
exclude=env/*,venv/*,.env/*,.venv/*,local_settings.py,doc/*,*/node_modules/*
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Topic :: Utilities",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries :: Python Modules",
],
description="Importable CLI-passthrough with bells and whistles.",
entry_points="""
[console_scripts]
cli-passthrough=cli_passthrough.cli:main
clipassthrough=cli_passthrough.cli:main
""",
extras_require={"dev": dev_requires},
include_package_data=True,
Expand Down