Skip to content

Commit 0836114

Browse files
authored
Bring project up to date and clean up tooling (JelteF#373)
- Remove flake8, it was an extremely outdated version - Remove stuff for converting to python 2 - Change Travis CI to Github Actions - Remove examples that used longtabu, since it's not maintained - Support up to Python 3.11
1 parent f6d6a1d commit 0836114

File tree

11 files changed

+55
-26
lines changed

11 files changed

+55
-26
lines changed

.github/workflows/ci.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Python package
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version:
13+
- "3.7"
14+
- "3.8"
15+
- "3.9"
16+
- "3.10"
17+
- "3.11"
18+
# Pip is broken in 3.12 for now
19+
# - "3.12.0-beta.4"
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
# Disable cache so that issues with new dependencies are found more easily
28+
# cache: 'pip'
29+
# cache-dependency-path: |
30+
# dev_requirements.txt
31+
# setup.py
32+
- name: Install dependencies
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install texlive-latex-extra texlive-pictures texlive-science texlive-fonts-recommended lmodern ghostscript
36+
python -m pip install --upgrade pip
37+
pip install -r dev_requirements.txt --upgrade
38+
sudo sed '/pattern=".*PDF.*"/d' -i /etc/ImageMagick*/policy.xml
39+
- name: Run tests
40+
run: |
41+
./testall.sh

README.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PyLaTeX |Travis| |License| |PyPi| |Stable Docs| |Latest Docs|
2-
=============================================================
1+
PyLaTeX |Actions| |License| |PyPi| |Stable Docs| |Latest Docs|
2+
==============================================================
33

44
PyLaTeX is a Python library for creating and compiling LaTeX files or
55
snippets. The goal of this library is being an easy, but extensible
@@ -51,8 +51,8 @@ Copyright and License
5151
Copyright 2014 Jelte Fennema, under `the MIT
5252
license <https://github.com/JelteF/PyLaTeX/blob/master/LICENSE>`__
5353

54-
.. |Travis| image:: https://img.shields.io/travis/JelteF/PyLaTeX.svg
55-
:target: https://travis-ci.org/JelteF/PyLaTeX
54+
.. |Actions| image:: https://github.com/JelteF/PyLaTeX/actions/workflows/ci.yml/badge.svg
55+
:target: https://github.com/JelteF/PyLaTeX/actions/workflows/ci.yml
5656

5757
.. |License| image:: https://img.shields.io/github/license/jeltef/pylatex.svg
5858
:target: https://github.com/JelteF/PyLaTeX/blob/master/LICENSE
File renamed without changes.
File renamed without changes.
File renamed without changes.

convert_to_py2.sh

-9
This file was deleted.

dev_requirements.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
-e .[all]
22
-e git+https://github.com/JelteF/sphinx.git@better-autodoc-skip-member#egg=sphinx
33
-e git+https://github.com/JelteF/sphinx_rtd_theme.git@master#egg=sphinx-rtd-theme
4-
-e git+https://github.com/JelteF/flake8-putty.git@master#egg=flake8-putty
5-
pyflakes==2.2.0

docs/source/conf.py

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
# serve to show the default.
1515

1616
import sys
17+
18+
# Needed for old sphinx version to work
19+
import collections
20+
if sys.version_info >= (3, 10):
21+
collections.Callable = collections.abc.Callable
22+
1723
import os
1824
import inspect
1925
import sphinx_rtd_theme

release.sh

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ set -x
2828

2929
git tag "$1" -a -m ''
3030

31-
./convert_to_py2.sh
3231
cd docs/gh-pages
3332
git pull
3433
git submodule update --init

setup.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@
2626
dependencies = ['ordered-set']
2727

2828
extras = {
29-
'docs': ['sphinx'],
29+
'docs': ['sphinx', 'jinja2<3.0', 'MarkupSafe==2.0.1', 'alabaster<0.7.12'],
3030
'matrices': ['numpy'],
3131
'matplotlib': ['matplotlib'],
3232
'quantities': ['quantities', 'numpy'],
33-
'testing': ['flake8<3.0.0', 'pep8-naming==0.8.2',
34-
'flake8_docstrings==1.3.0', 'pycodestyle==2.0.0',
35-
'pydocstyle==3.0.0', 'pyflakes==1.2.3', 'pytest>=4.6',
36-
'flake8-putty',
33+
'testing': ['pytest>=4.6',
3734
'coverage', 'pytest-cov'],
3835
'packaging': ['twine'],
39-
'convert_to_py2': ['3to2', 'future>=0.15.2'],
4036
}
4137

4238
if sys.version_info[0] == 3:

testall.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# This script runs flake8 to test for pep8 compliance and executes all the examples and tests
2+
# This script executes all the examples and tests
33
# run as: testall.sh [-p COMMAND] [clean]
44
# Optional positional arguments
55
# -c: cleans up the latex files generated
@@ -52,9 +52,7 @@ python_version_long=$($python --version |& sed 's|Python \(.*\)|\1|g' | head -n
5252
if [ "$python_version" = '3' ]; then
5353
# Check code guidelines
5454
echo -e '\e[32mChecking for code style errors \e[0m'
55-
if ! flake8 pylatex examples tests; then
56-
exit 1
57-
fi
55+
# TODO: Replace with black
5856
fi
5957

6058

0 commit comments

Comments
 (0)