Skip to content

Commit 84a80ff

Browse files
avanovTom X. TobinmovermeyerStephen
authored
Release 1.0.0 (#58)
* Fix minor doc typo "Litaral" -> "Literal" * Switched broken pypip.in badges to shields.io * Updating cli docs * add funding button * Add nix shell, confirm works on Python 3.9 * Shell, python310 * remove python2 from CI * Switch CI * add requires.io badge * switch to pytest, forget python2 * pytest * fix rst tests * install stylus before tests * f * fix coveralls * add coverage * Version bump * changelog * incorporate Pull request #55 Co-authored-by: Tom X. Tobin <[email protected]> Co-authored-by: Michael Overmeyer <[email protected]> Co-authored-by: Stephen <[email protected]>
1 parent 5f62ab6 commit 84a80ff

28 files changed

+270
-107
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [avanov]

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "CI"
2+
on:
3+
push:
4+
branches: [ master, develop ]
5+
pull_request:
6+
branches: [ master, develop ]
7+
8+
jobs:
9+
tests:
10+
strategy:
11+
matrix:
12+
python-version: [ 39, 310 ]
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/[email protected]
16+
with:
17+
submodules: recursive
18+
- uses: cachix/install-nix-action@v12
19+
with:
20+
install_url: https://releases.nixos.org/nix/nix-2.11.1/install
21+
extra_nix_config: "system-features = benchmark kvm"
22+
- name: Run tests on Python${{ matrix.python-version }}
23+
run: |
24+
nix-shell --argstr pyVersion ${{ matrix.python-version }} --run \
25+
"pip install -e . && pip install -r requirements.txt && pip install -r requirements-test.txt && python -m pytest"
26+
27+
- name: Coveralls
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: |
31+
nix-shell --argstr pyVersion ${{ matrix.python-version }} --run "coveralls --service=github"
32+
33+
coveralls:
34+
name: Coveralls [finalize]
35+
needs: tests
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/[email protected]
39+
with:
40+
submodules: recursive
41+
- uses: cachix/install-nix-action@v12
42+
with:
43+
install_url: https://releases.nixos.org/nix/nix-2.11.1/install
44+
extra_nix_config: "system-features = benchmark kvm"
45+
- name: Coveralls [finalize]
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
nix-shell --run "coveralls --service=github --finish"

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
build/
88
dist/
99
*.egg-info/
10+
*.eggs/
11+
*.local/
12+
__pycache__/
13+
# npm package lock, we don't need it as the 'stylus' dependency is optional
14+
package-lock.json
1015

1116
docs/_build
1217

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

CHANGES

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
================
33

4+
1.0.0
5+
-----
6+
7+
- Dropped support for Python 2.x
8+
- Test suite switched from Nose to Pytest
9+
- CI switched from Travis CI to Github Actions
10+
411
Version 0.9
512
-------------
613

README.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
Plim
22
==============
33

4-
.. image:: https://pypip.in/v/Plim/badge.png
4+
.. image:: https://img.shields.io/pypi/v/Plim.svg
55
:target: https://crate.io/packages/Plim
66

7-
.. image:: https://pypip.in/d/Plim/badge.png
8-
:target: https://crate.io/packages/Plim
7+
.. image:: https://requires.io/github/avanov/Plim/requirements.svg?branch=master
8+
:target: https://requires.io/github/avanov/Plim/requirements/?branch=master
9+
:alt: Requirements Status
910

10-
.. image:: https://api.travis-ci.org/avanov/Plim.png
11-
:target: https://travis-ci.org/avanov/Plim
11+
.. image:: https://img.shields.io/pypi/dm/Plim.svg
12+
:target: https://crate.io/packages/Plim
1213

13-
.. image:: https://coveralls.io/repos/avanov/Plim/badge.png?branch=develop
14-
:target: https://coveralls.io/r/avanov/Plim?branch=develop
14+
.. image:: https://github.com/avanov/Plim/workflows/CI/badge.svg?branch=develop
15+
:target: https://github.com/avanov/Plim/actions?query=branch%3Adevelop
1516

16-
.. image:: https://gemnasium.com/avanov/Plim.svg
17-
:target: https://gemnasium.com/avanov/Plim
17+
.. image:: https://coveralls.io/repos/github/avanov/Plim/badge.svg?branch=develop
18+
:target: https://coveralls.io/github/avanov/Plim?branch=develop
1819

1920

2021
Plim is a Python port of `Ruby's Slim template language <http://slim-lang.com/>`_

default.nix

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# https://nixos.wiki/wiki/Development_environment_with_nix-shell
2+
{ pkgs ? (import ./nixpkgs).pkgs
3+
, pyVersion ? "310"
4+
}:
5+
6+
let
7+
8+
python = pkgs."python${pyVersion}Full";
9+
pythonPkgs = pkgs."python${pyVersion}Packages";
10+
11+
devEnv = pkgs.mkShellNoCC {
12+
name = "plim-devenv";
13+
14+
# The packages in the `buildInputs` list will be added to the PATH in our shell
15+
# Python-specific guide:
16+
# https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md
17+
nativeBuildInputs = with pkgs; [
18+
# see https://nixos.org/nixos/packages.html
19+
# Python distribution
20+
python
21+
pythonPkgs.virtualenv
22+
pythonPkgs.wheel
23+
pythonPkgs.twine
24+
pythonPkgs.coveralls
25+
26+
nodejs
27+
nodePackages.npm
28+
taglib
29+
ncurses
30+
libxml2
31+
libxslt
32+
libzip
33+
zlib
34+
# root CA certificates
35+
cacert
36+
which
37+
];
38+
shellHook = ''
39+
# set SOURCE_DATE_EPOCH so that we can use python wheels
40+
export SOURCE_DATE_EPOCH=$(date +%s)
41+
42+
VENV_DIR=$PWD/.venv
43+
44+
export PATH=$VENV_DIR/bin:$PATH
45+
export PYTHONPATH=""
46+
export LANG=en_GB.UTF-8
47+
48+
# https://python-poetry.org/docs/configuration/
49+
export PIP_CACHE_DIR="$PWD/.local/pip-cache${pyVersion}"
50+
51+
# Setup virtualenv
52+
if [ ! -d $VENV_DIR ]; then
53+
virtualenv $PWD/.venv
54+
$VENV_DIR/bin/python -m pip install -e $PWD
55+
$VENV_DIR/bin/python -m pip install -r $PWD/requirements.txt
56+
fi
57+
58+
if [ ! -d $PWD/node_modules ]; then
59+
npm install stylus
60+
fi
61+
'';
62+
};
63+
64+
in
65+
{
66+
inherit devEnv;
67+
}

docs/cli.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ source files into Mako templates.
99
.. code-block:: shell
1010
1111
$ plimc -h
12-
usage: plimc [-h] [--encoding ENCODING] source target
12+
usage: plimc [-h] [-o OUTPUT] [-e ENCODING] [-p PREPROCESSOR] [-H] [-V] source
1313
1414
Compile plim source files into mako files.
1515
1616
positional arguments:
1717
source path to source plim template
18-
target path to target mako template
1918
2019
optional arguments:
2120
-h, --help show this help message and exit
22-
--encoding ENCODING source file encoding
21+
-o OUTPUT, --output OUTPUT
22+
write result to FILE.
23+
-e ENCODING, --encoding ENCODING
24+
content encoding
25+
-p PREPROCESSOR, --preprocessor PREPROCESSOR
26+
Preprocessor instance that will be used for parsing
27+
the template
28+
-H, --html Render HTML output instead of Mako template
29+
-V, --version show program's version number and exit
2330

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
# built documents.
4949
#
5050
# The short X.Y version.
51-
version = '0.9'
51+
version = '1.0'
5252
# The full version, including alpha/beta/rc tags.
53-
release = '0.9.12'
53+
release = '1.0.0'
5454

5555
# The language for content autogenerated by Sphinx. Refer to documentation
5656
# for a list of supported languages.

docs/differences.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Plim is *not the exact* port of Slim. Here is the full list of differences.
6161
#. In Plim, all html tags **MUST** be written in lowercase.
6262

6363
This restriction was introduced to support
64-
:ref:`Implicit Litaral Blocks <implicit-literals>` feature.
64+
:ref:`Implicit Literal Blocks <implicit-literals>` feature.
6565

6666
.. code-block:: slim
6767

0 commit comments

Comments
 (0)