Skip to content
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

Many updates #2

Open
wants to merge 6 commits into
base: 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
42 changes: 42 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
repository_dispatch:
types: [ doRelease ]

jobs:
Release:
name: Package and Publish to PyPI
runs-on: ubuntu-latest
env:
PYTHON: ${{ github.event.client_payload.PYTHON }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.ref }}

- name: Setup Python ${{ env.PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON }}

- name: Install dependencies for packaging and release
run: |
python -m pip install --upgrade pip
pip install wheel twine

- name: Build Python package (source distribution)
run: |
python setup.py sdist

- name: Build Python package (binary distribution - wheel)
run: |
python setup.py bdist_wheel

- name: Release Python package to PyPI
# if: startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
83 changes: 43 additions & 40 deletions .github/workflows/Workflow.yml → .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Test, Coverage and Release
name: Test and Coverage

on: [push]
on: [ push ]

jobs:
test:
name: Test and collect coverage data
Test:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 3
matrix:
python-version: [ 3.6, 3.7, 3.8 ]
python-version: [ 3.6, 3.7, 3.8, 3.9 ]

env:
PYTHON: ${{ matrix.python-version }}
Expand All @@ -28,63 +28,66 @@ jobs:
pip install -r tests/requirements.txt

- name: Run unit tests
# run: python -m unittest discover tests/unit *.py
run: |
python -m unittest tests.unit.Token
python -m pytest -rA --cov=.. --cov-config=tests/.coveragerc tests/unit

Coverage:
name: Collect Coverage Data
runs-on: ubuntu-latest
env:
PYTHON: 3.9
steps:
- uses: actions/checkout@v2

- name: Setup Python ${{ env.PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt

- name: Collect coverage
if: ${{ always() }}
# run: coverage run -m unittest discover tests/unit *.py
run: |
coverage run --append -m unittest tests.unit.Token
python -m pytest -rA --cov=.. --cov-config=tests/.coveragerc tests/unit

- name: Report coverage
- name: Convert to cobertura format
if: ${{ always() }}
run: |
coverage report
coverage xml

- name: Publish coverage at CodeCov
if: ${{ always() }}
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
env_vars: PYTHON

- name: Publish coverage at Codacy
if: ${{ always() }}
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage.xml

release:
name: Build packages and publish to PyPI if tagged
needs: [ test ]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
TriggerNext:
name: Trigger next Workflows
needs: [Test, Coverage]
runs-on: ubuntu-latest
env:
PYTHON: "3.8"
PYTHON: 3.9
steps:
- uses: actions/checkout@v2

- name: Setup Python ${{ env.PYTHON }}
uses: actions/setup-python@v2
- name: Trigger Release Workflow
if: startsWith(github.ref, 'refs/tags')
uses: peter-evans/repository-dispatch@v1
with:
python-version: ${{ env.PYTHON }}

- name: Install dependencies for packaging and release
run: |
python -m pip install --upgrade pip
pip install wheel twine

- name: Build Python package (source distribution)
run: |
python setup.py sdist

- name: Build Python package (binary distribution - wheel)
run: |
python setup.py bdist_wheel

- name: Release Python package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
token: ${{ secrets.TRIGGER_TOKEN_2 }}
# repository: vhdl/pyVHDLModel
event-type: doRelease
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "PYTHON": "${{ env.PYTHON }}"}'
19 changes: 16 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@
__pycache__/
*.py[cod]

# Sphinx documentation
doc/_build
# Python installation packages
dist/

# PyCharm project
# Coverage.py
.coverage
.cov
coverage.xml

# Sphinx
doc/_build/
doc/pyVHDLModel/**/*.*
!doc/pyVHDLModel/index.rst

# BuildTheDocs
doc/_theme/**/*.*

# IntelliJ project files
/.idea/workspace.xml
4 changes: 2 additions & 2 deletions .idea/pyTokenizer.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions doc/Dependencies.rst

This file was deleted.

66 changes: 66 additions & 0 deletions doc/Dependency.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.. _dependency:

Dependency
##########

.. _dependency-package:

pyTokenizer Package
*******************

+----------------------------------------------------+-------------+--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
| **Package** | **Version** | **License** | **Dependencies** |
+====================================================+=============+====================================================================+===============================================================================================================================+
| `pydecor <https://github.com/mplanchard/pydecor>`_ | ≥2.0.1 | `MIT <https://github.com/mplanchard/pydecor/blob/master/LICENSE>`_ | * `dill <https://github.com/uqfoundation/dill>`_ (`BSD 3-clause <https://github.com/uqfoundation/dill/blob/master/LICENSE>`_) |
| | | | * `six <https://github.com/benjaminp/six>`_ (`MIT <https://github.com/benjaminp/six/blob/master/LICENSE>`_) |
+----------------------------------------------------+-------------+--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+


.. _dependency-testing:

Unit Testing / Coverage
***********************

Additional Python packages needed for testing and code coverage collection.
These packages are only needed for developers or on a CI server, thus
sub-dependencies are not evaluated further.

+----------------------------------------------------------+-------------+---------------------------------------------------------------------------------------+----------------------+
| **Package** | **Version** | **License** | **Dependencies** |
+==========================================================+=============+=======================================================================================+======================+
| `pytest <https://github.com/pytest-dev/pytest>`_ | ≥6.2.1 | `MIT <https://github.com/pytest-dev/pytest/blob/master/LICENSE>`_ | *Not yet evaluated.* |
+----------------------------------------------------------+-------------+---------------------------------------------------------------------------------------+----------------------+
| `pytest-cov <https://github.com/pytest-dev/pytest-cov>`_ | ≥2.10.1 | `MIT <https://github.com/pytest-dev/pytest-cov/blob/master/LICENSE>`_ | *Not yet evaluated.* |
+----------------------------------------------------------+-------------+---------------------------------------------------------------------------------------+----------------------+
| `Coverage <https://github.com/nedbat/coveragepy>`_ | ≥5.3 | `Apache License, 2.0 <https://github.com/nedbat/coveragepy/blob/master/LICENSE.txt>`_ | *Not yet evaluated.* |
+----------------------------------------------------------+-------------+---------------------------------------------------------------------------------------+----------------------+


.. _dependency-documentation:

Sphinx Documentation
********************

Additional Python packages needed for documentation generation. These packages
are only needed for developers or on a CI server, thus sub-dependencies are not
evaluated further.

+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
| **Package** | **Version** | **License** | **Dependencies** |
+================================================================================================+==============+=========================================================================================================+======================+
| `Sphinx <https://github.com/sphinx-doc/sphinx>`_ | ≥3.4.1 | `BSD 3-Clause <https://github.com/sphinx-doc/sphinx/blob/master/LICENSE>`_ | *Not yet evaluated.* |
+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
| `sphinx_btd_theme <https://github.com/buildthedocs/sphinx.theme>`_ | | `MIT <https://github.com/buildthedocs/sphinx.theme/blob/master/LICENSE>`_ | *Not yet evaluated.* |
+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
| `autoapi <https://github.com/carlos-jenkins/autoapi>`_ | | `Apache License, 2.0 <https://github.com/carlos-jenkins/autoapi/blob/master/LICENSE>`_ | *Not yet evaluated.* |
+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
| !! `sphinx_fontawesome <https://github.com/fraoustin/sphinx_fontawesome>`_ | ≥0.0.6 | `GPL 2.0 <https://github.com/fraoustin/sphinx_fontawesome/blob/master/LICENSE>`_ | *Not yet evaluated.* |
+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
| `sphinx_autodoc_typehints <https://github.com/agronholm/sphinx-autodoc-typehints>`_ | ≥1.11.1 | `MIT <https://github.com/agronholm/sphinx-autodoc-typehints/blob/master/LICENSE>`_ | *Not yet evaluated.* |
+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
| `btd.sphinx.graphviz <https://github.com/buildthedocs/sphinx.graphviz>`_ | ≥2.3.1.post1 | `BSD 2-Clause <https://github.com/buildthedocs/sphinx.graphviz/blob/btd/master/LICENSE.md>`_ | *Not yet evaluated.* |
+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
| `btd.sphinx.inheritance_diagram <https://github.com/buildthedocs/sphinx.inheritance_diagram>`_ | ≥2.3.1.post1 | `BSD 2-Clause <https://github.com/buildthedocs/sphinx.inheritance_diagram/blob/btd/master/LICENSE.md>`_ | *Not yet evaluated.* |
+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
| `Pygments <https://github.com/pygments/pygments>`_ | ≥2.7.2 | `BSD 2-Clause <https://github.com/pygments/pygments/blob/master/LICENSE>`_ | *Not yet evaluated.* |
+------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------+----------------------+
19 changes: 18 additions & 1 deletion doc/Installation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
.. _installation:

Installation/Updates
####################



.. _installation-pip:

Using PIP
*********

Expand All @@ -17,4 +23,15 @@ Updating using PIP

.. code-block:: bash

pip3 install -U pyTokenizer
pip3 install -U pyTokenizer



.. _installation-setup:

Using setup.py
**************

.. todo::

Describe setup procedure using ``setup.py``
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# -- Project information -----------------------------------------------------

project = 'pyTokenizer'
copyright = '2007-2019, Patrick Lehmann'
copyright = '2007-2021, Patrick Lehmann'
author = 'Patrick Lehmann'

# The full version, including alpha/beta/rc tags
Expand Down
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This library is licensed under **Apache License 2.0**.

------------------------------------

.. |docdate| date:: %b %d, %Y - %H:%M
.. |docdate| date:: %d.%b %Y - %H:%M

.. only:: html

Expand All @@ -56,7 +56,7 @@ This library is licensed under **Apache License 2.0**.
:hidden:

Installation
Dependencies
Dependency

.. toctree::
:caption: Classes
Expand Down
Loading