Skip to content

Commit

Permalink
Merge pull request #160 from Pylons/structure
Browse files Browse the repository at this point in the history
refactor repo structure
  • Loading branch information
digitalresistor authored Nov 28, 2021
2 parents 368f1e7 + a44ad5c commit 57a097b
Show file tree
Hide file tree
Showing 79 changed files with 269 additions and 198 deletions.
5 changes: 3 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[run]
source =
pyramid_jinja2
omit =
pyramid_jinja2/scaffolds/__init__.py

[paths]
source =
Expand All @@ -11,5 +9,8 @@ source =
*/site-packages/pyramid_jinja2

[report]
omit =
*/pyramid_jinja2/scaffolds/__init__.py

show_missing = true
precision = 2
77 changes: 45 additions & 32 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,24 @@ jobs:
strategy:
matrix:
py:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "pypy3"
- "3.10"
- "pypy-3.7"
os:
- "ubuntu-latest"
- "windows-latest"
- "macos-latest"
architecture:
- x64
- x86

include:
# Only run coverage on ubuntu-latest, except on pypy3
- os: "ubuntu-latest"
pytest-args: "--cov"
- os: "ubuntu-latest"
py: "pypy3"
pytest-args: ""

exclude:
# Linux and macOS don't have x86 python
- os: "ubuntu-latest"
architecture: x86
- os: "macos-latest"
architecture: x86
# PyPy3 on Windows doesn't seem to work
- os: "windows-latest"
py: "pypy3"

name: "Python: ${{ matrix.py }}-${{ matrix.architecture }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -57,19 +44,45 @@ jobs:
architecture: ${{ matrix.architecture }}
- run: pip install tox
- name: Running tox
run: tox -e py -- ${{ matrix.pytest-args }}
run: tox -e py
test_old_pyramids:
strategy:
matrix:
pyramid:
- "pyramid13"
- "pyramid14"
- "pyramid15"
- "pyramid16"
- "pyramid17"
- "pyramid18"
- "pyramid19"
- "pyramid110"
- "pyramid20"
name: "Python: py39-${{ matrix.pyramid }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.9"
architecture: x64
- run: pip install tox
- name: Running tox
run: tox -e py39-${{ matrix.pyramid }}
coverage:
runs-on: ubuntu-latest
name: Validate coverage
steps:
- uses: actions/checkout@v2
- name: Setup python
- name: Setup python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
architecture: x64

- run: pip install tox
- run: tox -e py39-coverage
- run: tox -e py310-cover,coverage
docs:
runs-on: ubuntu-latest
name: Build the documentation
Expand All @@ -78,19 +91,19 @@ jobs:
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
architecture: x64
- run: pip install tox
- run: tox -e docs
# lint:
# runs-on: ubuntu-latest
# name: Lint the package
# steps:
# - uses: actions/checkout@v2
# - name: Setup python
# uses: actions/setup-python@v2
# with:
# python-version: 3.9
# architecture: x64
# - run: pip install tox
# - run: tox -e lint
# lint:
# runs-on: ubuntu-latest
# name: Lint the package
# steps:
# - uses: actions/checkout@v2
# - name: Setup python
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# architecture: x64
# - run: pip install tox
# - run: tox -e lint
6 changes: 3 additions & 3 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ License Terms
-------------

Code committed to the Pylons Project source repository (Committed Code) must
be governed by the Repoze Public License (http://repoze.org/LICENSE.txt, aka
"the RPL") or another license acceptable to Agendaless Consulting. Until
be governed by the Repoze Public License (see LICENSE.txt, aka "the RPL")
or another license acceptable to Agendaless Consulting. Until
Agendaless Consulting declares in writing an acceptable license other than
the RPL, only the RPL shall be used. A list of exceptions is detailed within
the "Licensing Exceptions" section of this document, if one exists.
Expand Down Expand Up @@ -134,4 +134,4 @@ Remco Verhoef (nl5887), 2013/11/08

Geoffrey Dairiki, 2013/11/22

Steve Piercy, 2016/01/07
Steve Piercy, 2016/01/07
24 changes: 19 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
recursive-include docs *
recursive-include pyramid_jinja2 *
graft src/pyramid_jinja2
graft tests
graft docs
graft demo
graft .github

recursive-exclude docs *.pyc
recursive-exclude pyramid_jinja2 *.pyc
include README.rst
include CHANGES.txt
include LICENSE.txt
include CONTRIBUTORS.txt
include COPYRIGHT.txt

include *.txt *.ini *.rst
include pyproject.toml
include setup.cfg
include .coveragerc
include tox.ini
include rtd.txt

prune docs/_build

recursive-exclude * __pycache__ *.py[cod]
2 changes: 1 addition & 1 deletion pyramid_jinja2/demo/__init__.py → demo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def app(global_settings, **settings):
config.include('pyramid_jinja2')
config.add_route(name='root', pattern='/')
config.add_view(root_view, renderer='helloworld.jinja2')
config.add_translation_dirs('pyramid_jinja2.demo:locale/')
config.add_translation_dirs('demo:locale/')
return config.make_wsgi_app()


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pyramid_jinja2/demo/test_demo.py → demo/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

class DemoTests(unittest.TestCase):
def test_root_view(self):
from pyramid_jinja2.demo import root_view
from demo import root_view
m = pyramid.testing.DummyRequest()
root_view(m)
self.assertEqual(m.locale_name, 'fr')

def test_app(self):
from pyramid_jinja2.demo import app
from demo import app
webapp = app({})
self.assertTrue(callable(webapp))

def test_main(self):
from pyramid_jinja2.demo import Mainer
from demo import Mainer

class MyMainer(Mainer):
def serve_forever(self):
Expand Down
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[build-system]
requires = ["setuptools >= 41"]
build-backend = "setuptools.build_meta"

[tool.black]
target-version = ['py37', 'py38', 'py39', 'py310']
exclude = '''
/(
\.git
| .tox
)/
'''

[tool.isort]
profile = "black"
multi_line_output = 3
src_paths = ["src", "tests"]
skip_glob = ["docs/*"]
include_trailing_comma = true
force_grid_wrap = false
combine_as_imports = true
line_length = 88
force_sort_within_sections = true
default_section = "THIRDPARTY"
known_first_party = "pyramid_jinja2"
3 changes: 0 additions & 3 deletions pyramid_jinja2/tests/templates/extends_spec.jinja2

This file was deleted.

69 changes: 58 additions & 11 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,18 +1,65 @@
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
[metadata]
name = pyramid_jinja2
version = 2.8
description = Jinja2 template bindings for the Pyramid web framework
long_description = file: README.rst, CHANGES.txt
long_description_content_type = text/x-rst
keywords = web wsgi pylons pyramid jinja2
license = BSD-derived (Repoze)
classifiers =
Development Status :: 6 - Mature,
Intended Audience :: Developers,
Programming Language :: Python,
Programming Language :: Python :: 3,
Programming Language :: Python :: 3.7,
Programming Language :: Python :: 3.8,
Programming Language :: Python :: 3.9,
Programming Language :: Python :: 3.10,
Framework :: Pyramid,
License :: Repoze Public License,
url = https://github.com/Pylons/pyramid_jinja2
project_urls =
Documentation = https://docs.pylonsproject.org/projects/pyramid_jinja2/en/latest/
Changelog = https://github.com/Pylons/pyramid_jinja2/blob/master/CHANGES.txt
Issue Tracker = https://github.com/Pylons/pyramid_jinja2/issues

[bdist_wheel]
universal = 1
author = Rocky Burt
author_email = pylons-discuss@googlegroups.com
maintainer = Pylons Project
maintainer_email = pylons-discuss@googlegroups.com

[aliases]
dev = develop easy_install pyramid_jinja2[testing]
docs = develop easy_install pyramid_jinja2[docs]
[options]
package_dir=
=src
packages=find:
python_requires = >=3.7.0
install_requires =
jinja2>=2.5.0,!=2.11.0,!=2.11.1,!=2.11.2
markupsafe
pyramid>=1.3.0 # pyramid.path.DottedNameResolver
zope.deprecation

[options.packages.find]
where=src

[options.entry_points]
pyramid.scaffold =
pyramid_jinja2_starter = pyramid_jinja2.scaffolds:Jinja2ProjectTemplate

[options.extras_require]
testing =
webtest
coverage
pytest>=5.4.2
pytest-cov

docs =
pylons-sphinx-themes >= 0.3
sphinx>=1.7.5

[tool:pytest]
python_files = test_*.py
testpaths =
pyramid_jinja2/demo
pyramid_jinja2/tests
demo
tests
addopts = -W always
Loading

0 comments on commit 57a097b

Please sign in to comment.