Skip to content

Commit

Permalink
Config with pure python (#2)
Browse files Browse the repository at this point in the history
* Lint the code.
* Add support for Python 3.7, 3.8 and 3.9.
* Drop support for Python 3.4.
  • Loading branch information
Michael Howitz committed Jan 27, 2021
1 parent a4adbaf commit 52e36fc
Show file tree
Hide file tree
Showing 23 changed files with 262 additions and 145 deletions.
7 changes: 0 additions & 7 deletions .coveragerc

This file was deleted.

39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
#
# EditorConfig Configuration file, for more details see:
# http://EditorConfig.org
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
# file types

# top-most EditorConfig file:
# Will ignore other EditorConfig files in Home directory or upper tree level.
root = true


[*] # For All Files
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Set default charset
charset = utf-8
# Indent style default
indent_style = space
# Max Line Length - a hard line wrap, should be disabled
max_line_length = off

[*.{py,cfg,ini}]
# 4 space indentation
indent_size = 4

[*.{yml,zpt,pt,dtml}]
# 2 space indentation
indent_size = 2

[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
indent_style = tab
indent_size = unset
tab_width = unset
57 changes: 57 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
name: tests

on:
push:
branches: [ master ]
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday

jobs:
build:
strategy:
matrix:
config:
# [Python version, tox env]
- ["3.8", "lint"]
- ["2.7", "py27"]
- ["3.5", "py35"]
- ["3.6", "py36"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["pypy2", "pypy"]
- ["pypy3", "pypy3"]
- ["3.8", "coverage"]

runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
pip install coveralls coverage-python-version
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 20 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
bin/
eggs/
develop-eggs/
parts/
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
*.egg-info/
*.profraw
*.pyc
*.pyo
.coverage
.coverage.*
.eggs/
.installed.cfg
*.py[co]
.mr.developer.cfg
.tox/
__pycache__/
bin/
build/
coverage.xml
develop-eggs/
dist/
*.egg-info/
.tox/
.coverage
docs/_build
eggs/
htmlcov/
lib/
lib64
parts/
pyvenv.cfg
32 changes: 32 additions & 0 deletions .meta.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = "pure-python"
commit-id = "2f8a259d7589d70e4fa73654d5a28f174f0959a0"

[python]
with-appveyor = false
with-pypy = true
with-legacy-python = true
with-docs = false
with-sphinx-doctests = false

[coverage]
fail-under = 98

[manifest]
additional-rules = [
"recursive-include src *.gif",
]

[flake8]
additional-config = [
"# F401 imported but unused",
"per-file-ignores =",
" src/zope/app/catalog/attribute.py: F401",
" src/zope/app/catalog/catalog.py: F401",
" src/zope/app/catalog/field.py: F401",
" src/zope/app/catalog/interfaces.py: F401",
" src/zope/app/catalog/keyword.py: F401",
" src/zope/app/catalog/text.py: F401",
]
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
CHANGES
=======

4.0.1 (unreleased)
4.1.0 (unreleased)
------------------

- Nothing changed yet.
- Add support for Python 3.7, 3.8 and 3.9.

- Drop support for Python 3.4.


4.0.0 (2017-05-05)
Expand Down
10 changes: 6 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
include *.py
include *.txt
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
include *.rst
include *.txt
include buildout.cfg
include .travis.yml
include tox.ini
include .coveragerc

recursive-include src *.pt
recursive-include src *.py
recursive-include src *.rst
recursive-include src *.txt
recursive-include src *.zcml
recursive-include src *.gif
52 changes: 0 additions & 52 deletions bootstrap.py

This file was deleted.

18 changes: 18 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[bdist_wheel]
universal = 1

[flake8]
doctests = 1
# F401 imported but unused
per-file-ignores =
src/zope/app/catalog/attribute.py: F401
src/zope/app/catalog/catalog.py: F401
src/zope/app/catalog/field.py: F401
src/zope/app/catalog/interfaces.py: F401
src/zope/app/catalog/keyword.py: F401
src/zope/app/catalog/text.py: F401

[check-manifest]
ignore =
.editorconfig
.meta.toml
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
import os
from setuptools import setup, find_packages


def read(*rnames):
with open(os.path.join(os.path.dirname(__file__), *rnames)) as f:
return f.read()


tests_require = [
'zope.app.appsetup',
'zope.app.basicskin >= 4.0.0',
Expand Down Expand Up @@ -55,15 +57,15 @@ def read(*rnames):
]

setup(name='zope.app.catalog',
version='4.0.1.dev0',
version='4.1.0.dev0',
author='Zope Corporation and Contributors',
author_email='zope-dev@zope.org',
description='Management pages for Zope Catalog',
long_description=(
read('README.rst')
+ '\n\n' +
read('CHANGES.rst')
),
),
keywords="zope3 catalog index",
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand All @@ -74,9 +76,11 @@ def read(*rnames):
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
Expand All @@ -99,4 +103,4 @@ def read(*rnames):
],
include_package_data=True,
zip_safe=False,
)
)
2 changes: 1 addition & 1 deletion src/zope/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
2 changes: 1 addition & 1 deletion src/zope/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
7 changes: 2 additions & 5 deletions src/zope/app/catalog/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Index interface-defined attributes
$Id$
"""
from zope.catalog.attribute import AttributeIndex # BBB
"""Index interface-defined attributes."""
from zope.catalog.attribute import AttributeIndex # BBB
1 change: 1 addition & 0 deletions src/zope/app/catalog/browser/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
from zope.catalog.interfaces import ICatalog


class Advanced(object):
"Provides a user interface for configuring a catalog"

Expand Down

0 comments on commit 52e36fc

Please sign in to comment.