From bb7c992d9c0a8aaa73a2dc984db4cc8dc5c2eb3b Mon Sep 17 00:00:00 2001 From: Jack Morgan Date: Fri, 21 May 2021 20:45:28 +1200 Subject: [PATCH 1/6] Test publishing package at Test PyPI --- .github/workflows/publish-to-pypi.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index ed0b46fa..67f85153 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,8 +1,6 @@ name: Publish to PyPI -on: - release: - types: [published] +on: push jobs: build-and-publish: @@ -26,7 +24,15 @@ jobs: run: | python -m build . - - name: Publish + - name: Publish to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + + - name: Publish to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master with: user: __token__ From 03ce1a13e65b4485863ed79a4f00d343712d2b06 Mon Sep 17 00:00:00 2001 From: Jack Morgan Date: Sat, 22 May 2021 11:00:05 +1200 Subject: [PATCH 2/6] Add build documentation workflow --- .github/workflows/documentation.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/documentation.yaml diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 00000000..0fc840d1 --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,27 @@ +name: Documentation + +on: [push] + +jobs: + build-documentation: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python 3 + uses: actions/setup-python@v2.2.2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-dev.txt + + - name: Build documentation + uses: ammaraskar/sphinx-action@master + with: + docs-folder: "docs/" From bc83b957c686e98ff7054353081cb78e81de6659 Mon Sep 17 00:00:00 2001 From: Jack Morgan Date: Sat, 22 May 2021 11:39:04 +1200 Subject: [PATCH 3/6] Update changelog --- README.rst | 4 ++-- docs/source/changelog.rst | 35 +++++++++++++++++++++++++++++++++++ docs/source/contributing.rst | 2 -- setup.cfg | 4 ++-- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 4bfd0756..58779178 100644 --- a/README.rst +++ b/README.rst @@ -67,7 +67,7 @@ FAQ **Where is the changelog?** -The changelog is available within the `CHANGELOG`_ file. +The changelog is available within the `documentation`_. **How do I install the development version as local package?** @@ -76,7 +76,7 @@ The changelog is available within the `CHANGELOG`_ file. 3. ``$ pip3 install .`` .. _ReadTheDocs: http://verto.readthedocs.io/en/latest/ -.. _CHANGELOG: CHANGELOG.md +.. _documentation: http://verto.readthedocs.io/en/latest/changelog.html .. _license file: LICENSE.md .. _existing and closed issues: https://github.com/uccser/verto/issues .. _open a new issue: https://github.com/uccser/verto/issues/new diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index c58c4c16..832df9a5 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -1,6 +1,41 @@ Changelog ####################################### +1.0.0 +======================================= + +This is the first official release of Verto, after over four years of use in production systems. +There are several changes in this release that may break existing pipelines and require changes. + +- Add new :doc:`processors/external-link` processor that modifies hyperlinks to open in a new tab. +- Modify :doc:`processors/scratch` and :doc:`processors/scratch-inline` processors to set Scratch code to be rendered by a JavaScript library. + + - This replaces the previous method of creating images. + - The ``split`` option has been removed as it is no longer relevant to the new method. + - The ``random`` option has been removed to improve consistency in rendered material. + + - Randomising the blocks can be achieved after rendering the code. + +- Use GitHub Actions for automated builds and publishing to PyPI. +- Use new declarative setup.cfg file for packaging configuration. +- Removed CodeClimate configuration file. +- Use GitHub Actions for automated testing (instead of Travis CI) and code analysis. +- Switch dependency tracking from PyUp to Dependabot. +- Move changelog outside of documentation to homepage for inclusion on PyPI homepage. +- Correct argument ``custom_settings`` to ``settings``. +- Update images for Scratch examples to use Scratch 3. +- Update regular expression strings in Python code to use raw strings. +- Updated authors to state UCCSER as primary owner. +- Dependency updates: + + - Update ``setuptools`` from 41.0.1 to 56.2.0. + - Update ``sphinx`` from 1.8.1 to 4.0.2. + - Update ``sphinx_rtd_theme`` from 0.4.3 to 0.5.2. + - Update ``coverage`` from 4.5.3 to 5.5. + - Update ``flake8`` from 3.5.0 to 3.9.2. + - Update ``Jinja2`` from 2.10.1 to 3.0.1. + - Update ``python-slugify`` from 3.0.2 to 5.0.2. + 0.11.0 ======================================= diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 03b3bbc7..48020755 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -397,8 +397,6 @@ Why are all dependency versions pinned? Yes, this is not considered the best practice by the Python Software Foundation in their `packaging guide `_. However pinning dependencies ensure we control over each Verto release, following the logic of `Vincent Driessen `_. -.. [1] We follow `Semantic Versioning `_ for our numbering system. The number is used by ``setup.py`` to tell PyPI which version is being uploaded or ``pip`` which version is installed, and also used during the documentation build to number the version of Verto it was built from. - .. _CS Unplugged: https://github.com/uccser/cs-unplugged/ .. _CS Field Guide: https://github.com/uccser/cs-field-guide/ .. _here: https://github.com/uccser/verto diff --git a/setup.cfg b/setup.cfg index 40734a8f..74cc48d1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ name = verto version = attr: verto.__version__ description = Verto is an extension of the Python Markdown package, which allows authors to include complex HTML elements with simple text tags in their Markdown. -long_description = file: README.rst, CHANGELOG.rst, LICENSE.rst +long_description = file: README.rst, LICENSE.rst author = University of Canterbury Computer Science Education Research Group author_email = csse-education-research@canterbury.ac.nz keywords = @@ -34,9 +34,9 @@ classifiers = project_urls = Issue Tracker = https://github.com/uccser/verto/issues Documentation = https://verto.readthedocs.io/en/latest/ + Changelog = http://verto.readthedocs.io/en/latest/changelog.html Source Code = https://github.com/uccser/verto - [options] packages = find: python_requires = >=3.6 From 7c12e495e79f789c6dd8422ce78823297b5d19f6 Mon Sep 17 00:00:00 2001 From: Jack Morgan Date: Sat, 22 May 2021 11:44:11 +1200 Subject: [PATCH 4/6] Ignore duplicate uploads to Test PyPI --- .github/workflows/publish-to-pypi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 67f85153..f8ea8856 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -30,6 +30,7 @@ jobs: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ + skip_existing: true - name: Publish to PyPI if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') From 6404e02754f9d91f882d389e0b4dd5940337bfef Mon Sep 17 00:00:00 2001 From: Jack Morgan Date: Sat, 22 May 2021 12:03:34 +1200 Subject: [PATCH 5/6] Modify documentation workflow step --- .github/workflows/documentation.yaml | 4 +--- docs/source/processors/blockquote.rst | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 0fc840d1..74aa2523 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -22,6 +22,4 @@ jobs: pip install -r requirements-dev.txt - name: Build documentation - uses: ammaraskar/sphinx-action@master - with: - docs-folder: "docs/" + run: sphinx-build -a -W -b html docs/source/ docs/build/ diff --git a/docs/source/processors/blockquote.rst b/docs/source/processors/blockquote.rst index 1fa79934..4ec91533 100644 --- a/docs/source/processors/blockquote.rst +++ b/docs/source/processors/blockquote.rst @@ -13,7 +13,7 @@ Optional Tag Parameters - ``footer`` - Boolean flag to indicate whether the blockquote contains a footer. - - If given as ``true``, then the last line should start with ``- `` to show it's the footer. + - If given as ``true``, then the last line should start with a dash (``-``) followed by a space to show it's the footer. - ``source`` - Sets the ``cite`` parameter of the ``blockquote`` element. From 761bc594118f8f55fa31615e509f503800b73eb4 Mon Sep 17 00:00:00 2001 From: Jack Morgan Date: Sat, 22 May 2021 12:39:16 +1200 Subject: [PATCH 6/6] Fix errors in building documentation --- .github/workflows/documentation.yaml | 2 +- docs/source/usage.rst | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 74aa2523..58b3c121 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -22,4 +22,4 @@ jobs: pip install -r requirements-dev.txt - name: Build documentation - run: sphinx-build -a -W -b html docs/source/ docs/build/ + run: sphinx-build -a -W -E -b html docs/source/ docs/build/ diff --git a/docs/source/usage.rst b/docs/source/usage.rst index fbe12995..51f419a8 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -170,8 +170,10 @@ Changing processors ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. automethod:: verto.Verto.update_processors(processors) + :noindex: .. automethod:: verto.Verto.processor_defaults(processors) + :noindex: This function is useful if you want to make minor changes to the default used processors. For example: You wish to still use all default processors but skip video tags: @@ -193,8 +195,10 @@ Changing HTML templates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. automethod:: verto.Verto.update_templates(html_templates) + :noindex: .. automethod:: verto.Verto.clear_templates() + :noindex: Full list of package methods =======================================