Commit d2430502 authored by Éloi Rivard's avatar Éloi Rivard

Stop support for python<3.7

parent 250d9ed7
......@@ -8,6 +8,8 @@ Change Log
- Stop support for ZODB4
- Stop support for python<3.7
2.5.0 (2021-05-12)
~~~~~~~~~~~~~~~~~~
......
# -*- coding: utf-8 -*-
#
# zodburi documentation build configuration file
#
......
......@@ -7,14 +7,14 @@ Overview
A library which parses URIs and converts them to ZODB storage objects and
database arguments.
It will run under CPython 2.7, 3.5 to 3.8, pypy and pypy3. It will not run under Jython. It requires ZODB >= 5.0.0.
It will run under CPython 3.7+ and pypy3. It will not run under Jython. It requires ZODB >= 5.0.0.
Installation
------------
Install using setuptools, e.g. (within a virtualenv)::
Install using pip, e.g. (within a virtualenv)::
$ easy_install zodburi
$ pip install zodburi
Using
-----
......
......@@ -8,13 +8,13 @@ here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
except IOError:
except OSError:
README = ''
try:
with open(os.path.join(here, 'CHANGES.rst')) as f:
CHANGES = f.read()
except IOError:
except OSError:
CHANGES = ''
requires = ['ZODB', 'ZConfig', 'ZEO']
......@@ -33,13 +33,12 @@ setup(name='zodburi',
classifiers=[
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"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 :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"License :: Repoze Public License",
......
[tox]
envlist =
py27,py35,py36,py37,py38,pypy,pypy3,cover,docs,lint
py37,py38,py39,py310,py311,pypy3,cover,docs,lint
[testenv]
commands =
......@@ -12,7 +12,7 @@ deps =
[testenv:cover]
basepython =
python3.7
python3.9
commands =
python setup.py nosetests --with-xunit --with-xcoverage
deps =
......@@ -29,7 +29,7 @@ deps =
[testenv:docs]
basepython =
python3.7
python3.11
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
deps =
......
......@@ -35,7 +35,7 @@ parameters = dict(database_name = 'database_name')
for parameter in connection_parameters:
parameters['connection_' + parameter] = parameter
has_units = re.compile('\s*(\d+)\s*([kmg])b\s*$').match
has_units = re.compile(r'\s*(\d+)\s*([kmg])b\s*$').match
units = dict(k=1<<10, m=1<<20, g=1<<30)
def _parse_bytes(s):
m = has_units(s.lower())
......
# -*- coding: utf-8 -*-
from io import BytesIO
import os
import re
......@@ -19,11 +18,8 @@ from zodburi._compat import parse_qsl
from zodburi._compat import urlsplit
from zodburi import _resolve_uri
# Capability test for older Pythons (2.x < 2.7.4, 3.x < 3.2.4)
(scheme, netloc, path, query, frag) = urlsplit('scheme:///path/#frag')
_BROKEN_URLSPLIT = frag != 'frag'
class Resolver(object):
class Resolver:
_int_args = ()
_string_args = ()
_bytesize_args = ()
......@@ -161,7 +157,7 @@ class ClientStorageURIResolver(Resolver):
return factory, unused
class ZConfigURIResolver(object):
class ZConfigURIResolver:
schema_xml_template = b"""
<schema>
......@@ -173,11 +169,6 @@ class ZConfigURIResolver(object):
def __call__(self, uri):
(scheme, netloc, path, query, frag) = urlsplit(uri)
if _BROKEN_URLSPLIT: #pragma NO COVER
# urlsplit used not to allow fragments in non-standard schemes,
# stuffed everything into 'path'
(scheme, netloc, path, query, frag
) = urlsplit('http:' + path)
path = os.path.normpath(path)
schema_xml = self.schema_xml_template
schema = loadSchemaFile(BytesIO(schema_xml))
......@@ -208,7 +199,7 @@ class ZConfigURIResolver(object):
return factory.open, dbkw
class DemoStorageURIResolver(object):
class DemoStorageURIResolver:
# demo:(base_uri)/(δ_uri)#dbkw...
# URI format follows XRI Cross-references to refer to base and δ
......
import mock
from unittest import mock
import unittest
......
import mock
from unittest import mock
import pkg_resources
import unittest
......@@ -208,8 +208,8 @@ class TestFileStorageURIResolver(Base, unittest.TestCase):
def test_dbargs(self):
resolver = self._makeOne()
factory, dbkw = resolver(
('file:///tmp/../foo/bar?connection_pool_size=1'
'&connection_cache_size=1&database_name=dbname'))
'file:///tmp/../foo/bar?connection_pool_size=1'
'&connection_cache_size=1&database_name=dbname')
self.assertEqual(dbkw, {'connection_cache_size': '1',
'connection_pool_size': '1',
'database_name': 'dbname'})
......@@ -487,7 +487,7 @@ class TestZConfigURIResolver(unittest.TestCase):
database-name foo
%s
</zodb>
""" % '\n'.join("%s %s" % (
""" % '\n'.join("{} {}".format(
name.replace('_', '-'),
'%sMB' % i if name in bytes_parameters else i,
)
......@@ -587,7 +587,7 @@ class TestDemoStorageURIResolver(unittest.TestCase):
changef = os.path.join(tmpdir, 'changes.fs')
self.assertFalse(os.path.exists(basef))
self.assertFalse(os.path.exists(changef))
factory, dbkw = resolver('demo:(file://%s)/(file://%s?quota=200)' % (basef, changef))
factory, dbkw = resolver('demo:(file://{})/(file://{}?quota=200)'.format(basef, changef))
self.assertEqual(dbkw, {})
demo = factory()
from ZODB.DemoStorage import DemoStorage
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment