Skip to content

Commit

Permalink
Refactor wildq
Browse files Browse the repository at this point in the history
* use click for CLI
* add input and output format (close #1)
* colorize output
* add tests and doc
* move from travis to github actions
* build using pyinstaller for linux and macos
  • Loading branch information
ahmet2mir committed Oct 14, 2020
1 parent 412f92b commit b53096f
Show file tree
Hide file tree
Showing 45 changed files with 1,666 additions and 540 deletions.
6 changes: 5 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[run]
branch = True
source = wildq
omit = wildq/__main__.py
omit =
wildq/__main__.py
wildq/_wildq_version.py
tests/data/*
*/site-packages/*

[report]
exclude_lines =
Expand Down
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Hi there,

Thank you for opening an issue. Please note that we try to keep the Wildq issue tracker reserved for bug reports and feature requests.

### Wildq Version
Run `wildq --version` to show the version. If you are not running the latest version of Wildq, please upgrade because your issue may have already been fixed.

### Affected FileType(s)
Please list the filetypes as a list, for example:
- json
- toml

If this issue appears to affect multiple filetypes, it may be an issue with Wildq's core and not third-parties, so please mention this.

### Debug Output
Please provider a link to a GitHub Gist containing the complete output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

### Panic Output
If wildq produced a stacktrace, please provide a link to a GitHub Gist containing the output.

### Expected Behavior
What should have happened?

### Actual Behavior
What actually happened?

### Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
1. `wildq -i ...`

### References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
- GH-1234
84 changes: 84 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Publish packages

on:
push:
tags:
- 'v*'

jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
id: ${{ steps.draft_release.outputs.id }}
html_url: ${{ steps.draft_release.outputs.html_url }}
upload_url: ${{ steps.draft_release.outputs.upload_url }}
steps:
- name: Create release
id: draft_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

assets:
name: Release packages
runs-on: ${{ matrix.os }}
needs: create_release
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
steps:
- name: Check out src from Git
uses: actions/checkout@v2

- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6

- name: Build a binary wheel and a source tarball
run: |
python -m pip install -U setuptools pipenv wheel
make init sync
python setup.py --version
make build binary
zip --junk-paths wildq-${{runner.os}}-x86_64 dist/wq dist/wildq
rm -f dist/wq dist/wildq
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./wildq-${{runner.os}}-x86_64.zip
asset_name: wildq-${{runner.os}}-x86_64.zip
asset_content_type: application/zip

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
if: matrix.os == 'ubuntu-latest'
with:
password: ${{ secrets.GH_ACTIONS_WILD }}

- name: Unset draft
if: matrix.os == 'ubuntu-latest'
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.create_release.outputs.id }}
33 changes: 33 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Unit Tests
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools pipenv
make init
- name: Syntax
run: |
make syntax
- name: Test
run: |
make test
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
.eggs

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -183,4 +184,10 @@ ignore/
.venv
trash/
result.json
Pipfile*
.DS_Store
.vscode
pip-wheel-metadata/
# wildq/_wildq_version.py
.idea
*.swp
Pipfile.lock
Loading

0 comments on commit b53096f

Please sign in to comment.