Skip to content

Commit

Permalink
Merge pull request #9 from pazembrz/fix_versioning
Browse files Browse the repository at this point in the history
setup: fix package versioning
  • Loading branch information
pazembrz authored Dec 9, 2020
2 parents a238268 + d917954 commit 1b401e4
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 38 deletions.
15 changes: 15 additions & 0 deletions .github/actions/install-python-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Install python dependencies
description: Setup python packages and requirements

runs:
using: composite
steps:
- name: Setup python additional packages
shell: bash
run: |
python -m pip install --upgrade pip
pip install setuptools wheel py coveralls
- name: Install requirements
shell: bash
run: pip install -e .[tests]
19 changes: 19 additions & 0 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run tests
description: Run all required tests

runs:
using: composite
steps:
- name: Run isort
shell: bash
run: isort -rc -c -df

- name: Run pytest
shell: bash
run: >
py.test
--pep8
--cov=jsonschema2rst
--cov-report=term-missing
tests
jsonschema2rst
92 changes: 92 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build and release

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
Test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.6]

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Cache Python
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ github.sha }}

- name: Install python dependencies
uses: ./.github/actions/install-python-dependencies

- name: Show python dependencies
run: pip freeze

- name: Run tests
uses: ./.github/actions/run-tests

- name: Coveralls
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel: true
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.test_number }}

Coveralls:
needs: Test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@v20201129
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

Release:
if: ${{ github.event_name == 'push' }}
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python 2.7
uses: actions/setup-python@v2
with:
python-version: 2.7

- name: Cache Python Dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-2.7-${{ github.sha }}

- name: Install python dependencies
uses: ./.github/actions/install-python-dependencies

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ target/
celerybeat-schedule

# dotenv
.env
.env*

# virtualenv
venv/
Expand Down
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,25 @@
readme = open('README.rst').read()

tests_require = [
'pytest',
"coverage>=4.0",
"isort>=4.2.2",
"isort<5.0.0",
"pytest-cache>=1.0",
"pytest-cov>=1.8.0",
"pytest-pep8>=1.0.6",
"pytest>=3.0.3",
"pytest<6.0.0",
"mock>=2.0.0",
]

install_requires = [
'pyyaml',
'autosemver',
'isort',
'autosemver==0.5.5',
'isort<5.0.0',
'six',
]


setup(
name='jsonschema2rst',
version='1.0',
author='CERN',
author_email='[email protected]',
description='Parser for yaml/json schemas to rst',
Expand Down

0 comments on commit 1b401e4

Please sign in to comment.