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

Add development setup and some clean up #24

Merged
merged 6 commits into from
Oct 7, 2023
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:

strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.9"]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ __pycache__/

# Virtualenv
/env/
/venv/
/.venv/

# Buildout
/bin/
Expand All @@ -31,3 +33,6 @@ __pycache__/

# Sphinx documentation
/doc/build/

# Editor
/.vscode
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: "3.9.2"
rev: "6.1.0"
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
rev: v3.14.0
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]
18 changes: 10 additions & 8 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,38 @@ CHANGES
0.3 (unreleased)
================

- Apply `pyupgrade --py36-plus`
- Apply `pyupgrade --py37-plus`

- Use black code formatter.

- Add support for Python 3.7, 3.8, 3.9 and 3.10.
- Add support for Python 3.7, 3.8, 3.9, 3.10, 3.11 and PyPy 3.

- Fix test collection.

- Drop support for Python 2.7, 3.4, 3.5.

- Updated the test suite to work with Morepath 0.15.

- Set up integration with Travis CI. (superseded)

- Added Tox environments for Python 3.5 and 3.6, PyPy 3, PEP8. (partially superseded)

- Using Python 3.5 for PEP8 and coverage. (superseded)

- Clean up meta data.

- Use GitHub Actions for CI.

- Fix Jinja2 integration - the ``autoescape`` extension was removed as now it
is built-in.

- Remove buildout

- Add development setup

- Sort imports with isort


0.2 (2015-04-09)
================

- Actual release to PyPI.


0.1 (2015-04-09)
================

Expand Down
30 changes: 0 additions & 30 deletions buildout.cfg

This file was deleted.

7 changes: 7 additions & 0 deletions develop_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# development
-e '.[test,lint]'
pre-commit
tox >= 2.4.1

# releaser
zest.releaser[recommended]
2 changes: 1 addition & 1 deletion more/jinja2/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import morepath
import jinja2
import morepath


class Jinja2App(morepath.App):
Expand Down
5 changes: 3 additions & 2 deletions more/jinja2/tests/test_jinja2.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from webtest import TestApp as Client

from .fixtures import (
template,
template_inheritance,
override_template,
override_template_inheritance,
template,
template_inheritance,
)


Expand Down
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[tool.black]
line-length = 80
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs
| \.git
| \.tox
| \.venv
| __pypackages__
| build
| dist
| env
| venv
)/
)
'''

[tool.pytest.ini_options]
testpaths = "more"
addopts = "-v"
filterwarnings = [
'ignore:.*pkg_resources.*:DeprecationWarning',
]

[tool.coverage.run]
source = ["more.jinja2"]

[tool.coverage.report]
show_missing = true

[tool.isort]
profile = 'black'
py_version = 39
skip_gitignore = true

[tool.zest-releaser]
create-wheel = true
16 changes: 12 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup, find_packages
from setuptools import find_packages, setup

long_description = "\n".join(
(
Expand All @@ -24,13 +24,21 @@
classifiers=[
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
python_requires=">=3.6",
python_requires=">=3.7",
install_requires=["setuptools", "morepath >= 0.15", "Jinja2 >= 2.9"],
extras_require=dict(test=["pytest >= 7", "pytest-cov", "WebTest"]),
extras_require=dict(
test=["pytest >= 7", "pytest-cov", "WebTest"],
lint=[
"black == 23.9.1",
"flake8 == 6.1.0",
"pyupgrade == 3.14.0",
"isort == 5.12.0",
],
),
)
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py37,py38,py39,py310,pypy3,coverage,pre-commit
envlist = py37,py38,py39,py310,py311,pypy3,coverage,pre-commit

[testenv]
setenv = PY_IGNORE_IMPORTMISMATCH = 1
Expand All @@ -19,14 +19,14 @@ commands = pre-commit run --all-files --show-diff-on-failure

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39, pre-commit, mypy, coverage
3.10: py310
3.11: py311
pypy-3.9: pypy3

[flake8]
show-source = True
max-line-length = 88
ignore =
E231 # clashes with black
W503
ignore = E231, W503