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

Modernize python versions #34

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
strategy:
matrix:
python:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- '3.7'
- 'pypy-3.7'
- 'pypy-3.8'

steps:
- uses: actions/checkout@v2
Expand Down
26 changes: 22 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,36 @@
Change Log
----------

2.6.1 (unreleased)
3.0.0 (unreleased)
~~~~~~~~~~~~~~~~~~

- Deprecate ``?demostorage`` in favour of ``demo:`` URI scheme.
- Rename private :func:`zodburi._resolve_uri` helper to
:func:`_get_uri_factory_and_dbkw` for clarity. Preserve original name
as a backward-compatibility alias (even though private, downstreams may
have found it needful to use the function).

- Update unit tests using :mod:`pytest` idioms, dropping th
:class:`unittest.TestCase` classes.

- Remove Python2 compatibility shims.

- Replace use of deprecated :mod:`pkg_resources` APIs with new
:mod:`importlib.metadata` versions.

- Add support for Python 3.9 - 3.12.

- Drop support for Python 3.7.

- Deprecate ``?demostorage`` query string parameter in favour of
``demo:`` URI scheme.


2.6.0 (2023-05-17)
~~~~~~~~~~~~~~~~~~

- Stop support for ZODB4
- Drop support for ZODB4.

- Stop support for python<3.7
- Drop support for python < 3.7.


2.5.0 (2021-05-12)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#sys.path.append(os.path.abspath('some/directory'))

import datetime
import pkg_resources
import importlib.metadata
import pylons_sphinx_themes

# General configuration
Expand Down Expand Up @@ -48,7 +48,7 @@
# other places throughout the built documents.
#
# The short X.Y version.
version = pkg_resources.get_distribution('zodburi').version
version = importlib.metadata.version('zodburi')
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
84 changes: 84 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "zodburi"
version = "3.0dev0"
dynamic = ["readme"]
description="Construct ZODB storage instances from URIs."
keywords = [
"zodb",
"zodbconn",
]
authors = [
{name = "Chris Rossi", email = "pylons-discuss@googlegroups.com"},
]
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"License :: Repoze Public License",
]
requires-python = ">=3.8"
dependencies = [
"ZODB",
"ZConfig",
"ZEO"
]

[project.entry-points.'zodburi.resolvers']
zeo = "zodburi.resolvers:client_storage_resolver"
file = "zodburi.resolvers:file_storage_resolver"
zconfig = "zodburi.resolvers:zconfig_resolver"
memory = "zodburi.resolvers:mapping_storage_resolver"
demo = "zodburi.resolvers:demo_storage_resolver"

[project.urls]
Homepage = "https://docs.pylonsproject.org/projects/zodburi/en/latest/"
Repository = "https://github.com/Pylons/zodburi"
Issues = "https://github.com/Pylons/zodburi/issues"
Changelog = "https://github.com/Pylons/zodburi/blob/master/CHANGES.rst"

[project.optional-dependencies]
testing = [
"pytest",
"pytest-cov",
"check-manifest",
]
docs = [
"Sphinx",
"pylons-sphinx-themes",
]

[tool.setuptools]
packages = ["zodburi"]

[tool.setuptools.dynamic]
readme = {file = ["README.rst", "CHANGES.rst"]}

[tool.pytest.ini_options]
addopts = [
"-l",
"--strict",
]
norecursedirs = [
"lib",
"include",
".tox",
".git",
]
python_files = "test_*.py"
filterwarnings = [
"ignore::DeprecationWarning:pkg_resources",
]

[tool.coverage.report]
show_missing = true
13 changes: 0 additions & 13 deletions setup.cfg

This file was deleted.

68 changes: 1 addition & 67 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,69 +1,3 @@
import os

from setuptools import setup
from setuptools import find_packages

here = os.path.abspath(os.path.dirname(__file__))

try:
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
except OSError:
README = ''

try:
with open(os.path.join(here, 'CHANGES.rst')) as f:
CHANGES = f.read()
except OSError:
CHANGES = ''

requires = ['ZODB', 'ZConfig', 'ZEO']
tests_require = requires + ['mock']
testing_extras = tests_require + ['nose', 'coverage']
docs_extras = tests_require + [
'Sphinx >= 1.8.1',
'repoze.sphinx.autointerface',
'pylons-sphinx-themes >= 1.0.10',
]

setup(name='zodburi',
version='2.6.1dev0',
description=('Construct ZODB storage instances from URIs.'),
long_description=README + '\n\n' + CHANGES,
classifiers=[
"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",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"License :: Repoze Public License",
],
keywords='zodb zodbconn',
author="Chris Rossi",
author_email="pylons-discuss@googlegroups.com",
url="https://pylonsproject.org/",
license="BSD-derived (http://www.repoze.org/LICENSE.txt)",
packages=find_packages(),
include_package_data=True,
zip_safe=False,
tests_require = tests_require,
install_requires = requires,
test_suite="zodburi",
entry_points="""\
[zodburi.resolvers]
zeo = zodburi.resolvers:client_storage_resolver
file = zodburi.resolvers:file_storage_resolver
zconfig = zodburi.resolvers:zconfig_resolver
memory = zodburi.resolvers:mapping_storage_resolver
demo = zodburi.resolvers:demo_storage_resolver
""",
extras_require = {
'testing': testing_extras,
'docs': docs_extras,
},
)
setup()
17 changes: 8 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[tox]
envlist =
py37,py38,py39,py310,py311,pypy3,cover,docs,lint
py38,py39,py310,py311,py312,pypy3,cover,docs,lint

[testenv]
commands =
python setup.py -q test -q
py.test -q
deps =
mock
pytest
ZODB==5.*
ZEO==5.*

[testenv:cover]
basepython =
python3.9
python3.12
commands =
python setup.py nosetests --with-xunit --with-xcoverage
pytest --cov=zodburi --cov-fail-under=100
deps =
{[testenv]deps}
nose
coverage
nosexcover
pytest
pytest-cov

# we separate coverage into its own testenv because a) "last run wins" wrt
# cobertura jenkins reporting and b) pypy and jython can't handle any
Expand All @@ -29,7 +28,7 @@ deps =

[testenv:docs]
basepython =
python3.11
python3.12
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
deps =
Expand Down
Loading
Loading