Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodburi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
zodburi
Commits
d2430502
Commit
d2430502
authored
Feb 15, 2023
by
Éloi Rivard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop support for python<3.7
parent
250d9ed7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
32 deletions
+23
-32
CHANGES.rst
CHANGES.rst
+2
-0
docs/conf.py
docs/conf.py
+0
-1
docs/index.rst
docs/index.rst
+3
-3
setup.py
setup.py
+5
-6
tox.ini
tox.ini
+3
-3
zodburi/__init__.py
zodburi/__init__.py
+1
-1
zodburi/resolvers.py
zodburi/resolvers.py
+3
-12
zodburi/tests/__init__.py
zodburi/tests/__init__.py
+1
-1
zodburi/tests/test_resolvers.py
zodburi/tests/test_resolvers.py
+5
-5
No files found.
CHANGES.rst
View file @
d2430502
...
...
@@ -8,6 +8,8 @@ Change Log
- Stop support for ZODB4
- Stop support for python<3.7
2.5.0 (2021-05-12)
~~~~~~~~~~~~~~~~~~
...
...
docs/conf.py
View file @
d2430502
# -*- coding: utf-8 -*-
#
# zodburi documentation build configuration file
#
...
...
docs/index.rst
View file @
d2430502
...
...
@@ -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
-----
...
...
setup.py
View file @
d2430502
...
...
@@ -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
IO
Error
:
except
OS
Error
:
README
=
''
try
:
with
open
(
os
.
path
.
join
(
here
,
'CHANGES.rst'
))
as
f
:
CHANGES
=
f
.
read
()
except
IO
Error
:
except
OS
Error
:
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.ini
View file @
d2430502
[tox]
envlist
=
py
27,py35,py36,py37,py38,pypy
,pypy3,cover,docs,lint
py
37,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
=
...
...
zodburi/__init__.py
View file @
d2430502
...
...
@@ -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())
...
...
zodburi/resolvers.py
View file @
d2430502
# -*- 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 δ
...
...
zodburi/tests/__init__.py
View file @
d2430502
import
mock
from
unittest
import
mock
import
unittest
...
...
zodburi/tests/test_resolvers.py
View file @
d2430502
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment