Skip to content

Commit

Permalink
Use poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Jun 18, 2023
1 parent 2c5ce1b commit 2eb6dac
Show file tree
Hide file tree
Showing 18 changed files with 2,247 additions and 579 deletions.
117 changes: 98 additions & 19 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,126 @@ on:
branches: [ develop ]

jobs:
test:
python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
poetry-version: ["1.5.1"]
pandoc-version: ["3.1.3"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry ${{ matrix.poetry-version }}
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
sudo dpkg -i ./pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
poetry install
- name: Test with tox
run: |
poetry run tox -e py
poetry:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.11"]
poetry-version: ["1.2.2", "1.3.2", "1.4.2", "1.5.1"]
pandoc-version: ["3.1.3"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry ${{ matrix.poetry-version }}
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
sudo dpkg -i ./pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
poetry install
- name: Test with tox
run: |
poetry run tox -e py
pandoc:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.5.1"]
pandoc-version: ["2.11.4", "2.12", "2.13", "2.14.2", "2.15", "2.16.2", "2.17.1.1", "2.18", "2.19.2", "3.0.1", "3.1.3"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry ${{ matrix.poetry-version }}
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/2.11.4/pandoc-2.11.4-1-amd64.deb
sudo dpkg -i pandoc-2.11.4-1-amd64.deb
python -m pip install --upgrade pip
pip install .[docs,test]
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
sudo dpkg -i ./pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
poetry install
- name: Test with tox
run: |
tox -e py
poetry run tox -e py
cov:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.5.1'
- name: Install dependencies
run: |
poetry install
- name: Test with tox
run: |
poetry run tox -e style
poetry run tox -e linter
cov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.11'
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.5.1'
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/2.11.4/pandoc-2.11.4-1-amd64.deb
sudo dpkg -i pandoc-2.11.4-1-amd64.deb
python -m pip install --upgrade pip
pip install setuptools coveralls .[test]
wget https://github.com/jgm/pandoc/releases/download/3.1.3/pandoc-3.1.3-1-amd64.deb
sudo dpkg -i ./pandoc-3.1.3-1-amd64.deb
poetry install
- name: Test
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
coverage run --source=pandoc_latex_environment setup.py test
coveralls
poetry run tox -e coverage
poetry run pip install coveralls
poetry run coveralls
20 changes: 11 additions & 9 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
python-version: '3.x'
poetry-version: '1.5.1'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
poetry install
poetry run pip install twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
poetry build
poetry run twine upload dist/*
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2016-2021, Christophe Demko
Copyright (c) 2016-2023, Christophe Demko
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# pandoc-latex-environment
# Installation

![Python package](https://github.com/chdemko/pandoc-latex-environment/workflows/Python%20package/badge.svg?branch=develop)
[![Coveralls](https://img.shields.io/coveralls/github/chdemko/pandoc-latex-environment/develop.svg)](https://coveralls.io/github/chdemko/pandoc-latex-environment?branch=develop)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/chdemko/pandoc-latex-environment.svg)](https://scrutinizer-ci.com/g/chdemko/pandoc-latex-environment/)
[![PyPI version](https://img.shields.io/pypi/v/pandoc-latex-environment.svg)](https://pypi.org/project/pandoc-latex-environment/)
[![Poetry version](https://img.shields.io/badge/poetry-1.2%20|%201.3%20|%201.4%20|%201.5-blue.svg)](https://python-poetry.org/)
[![Pandoc version](https://img.shields.io/badge/pandoc-2.11%20|%202.12%20|%202.13%20|%202.14%20|%202.15%20|%202.16%20|%202.17%20|%202.18%20|%202.19%20|%203.0%20|%203.1-blue.svg)](https://pandoc.org/)
[![PyPI format](https://img.shields.io/pypi/format/pandoc-latex-environment.svg)](https://pypi.org/project/pandoc-latex-environment/)
[![License](https://img.shields.io/pypi/l/pandoc-latex-environment.svg)](https://raw.githubusercontent.com/chdemko/pandoc-latex-environment/develop/LICENSE)
[![Python version](https://img.shields.io/pypi/pyversions/pandoc-latex-environment.svg)](https://pypi.org/project/pandoc-latex-environment/)
Expand All @@ -12,39 +15,34 @@

[pandoc]: http://pandoc.org/

Documentation
-------------

See the [wiki pages](https://github.com/chdemko/pandoc-latex-environment/wiki).

Usage
-----

To apply the filter, use the following option with pandoc:

--filter pandoc-latex-environment

Installation
Instructions
------------

*pandoc-latex-environment* requires [python], a programming language that comes pre-installed on linux and Mac OS X, and which is easily installed [on Windows]. Either python 2.7 or 3.x will do.
*pandoc-latex-environment* requires [python], a programming language that comes pre-installed on linux and Mac OS X, and which is easily installed [on Windows].

Install *pandoc-latex-environment* as root using the bash command
Install *pandoc-latex-environment* using the bash command

pip install pandoc-latex-environment
~~~shell
$ pip install pandoc-latex-environment
~~~

To upgrade to the most recent release, use

pip install --upgrade pandoc-latex-environment
~~~shell
$ pip install --upgrade pandoc-latex-environment
~~~

To upgrade to the current code, use

pip install --upgrade --force git+https://github.com/chdemko/pandoc-latex-environment
~~~shell
$ pip install --upgrade --force git+https://github.com/chdemko/pandoc-latex-environment
~~~

`pip` is a script that downloads and installs modules from the Python Package Index, [PyPI]. It should come installed with your python distribution. If you are running linux, `pip` may be bundled separately. On a Debian-based system (including Ubuntu), you can install it as root using

apt-get update
apt-get install python-pip
~~~shell
$ apt-get install python3-pip
~~~

[python]: https://www.python.org/
[on Windows]: https://www.python.org/downloads/windows/
Expand Down
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../README.md
```
116 changes: 116 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys

sys.path.insert(0, os.path.abspath("../.."))

on_rtd = os.environ.get("READTHEDOCS", None) == "True"

# -- Project information -----------------------------------------------------

project = "pandoc-latex-environment"
copyright = "2016-2023, Christophe Demko"
author = "Christophe Demko"

# The short X.Y version
version = "1.1"
# The full version, including alpha/beta/rc tags
release = "1.1.6.1"


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
needs_sphinx = "6.0"

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'myst_parser'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = []

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}


# The master toctree document.
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['images']

# The name of the Pygments (syntax highlighting) style to use.
# pygments_style = None
pygments_style = "sphinx"


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}

10 changes: 10 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Welcome to pandoc-latex-environment's documentation!
======================================================

.. toctree::
:maxdepth: 2
:caption: Contents

Installation <README>
Usage <usage>

4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Sphinx>=6.0
sphinx_rtd_theme>=1.2
myst-parser>=2.0

Loading

0 comments on commit 2eb6dac

Please sign in to comment.