Skip to content
Snippets Groups Projects
Commit 1679b9dd authored by Yogeswaran Umasankar's avatar Yogeswaran Umasankar
Browse files

New upstream version 3.3.2

parent a25a7c2e
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12, "3.13.0-alpha.6", "pypy-3.10"]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12, "3.13.0-beta.3", "pypy-3.10"]
exclude:
- os: macos-latest
python-version: 3.8
......@@ -36,7 +36,7 @@ jobs:
python -m pip install --upgrade pip
pip install setuptools
- name: Install optional dependencies
if: ${{ matrix.python-version != '3.13.0-alpha.6' }}
if: ${{ matrix.python-version != '3.13.0-beta.3' }}
run: pip install lxml jinja2
- name: Test with unittest
run: |
......@@ -48,5 +48,5 @@ jobs:
flake8 xmlschema --max-line-length=100 --statistics
- name: Lint with mypy
run: |
pip install mypy==1.10.0 elementpath==4.4.0 lxml-stubs
pip install mypy==1.11.0 elementpath==4.4.0 lxml-stubs
mypy --show-error-codes --strict xmlschema
......@@ -2,6 +2,10 @@
CHANGELOG
*********
`v3.3.2`_ (2024-07-29)
======================
* Fix UNC path tests (issues #405 and #408)
`v3.3.1`_ (2024-04-27)
======================
* Update validation errors with logging stacktrace in debug mode
......@@ -704,3 +708,4 @@ v0.9.6 (2017-05-05)
.. _v3.2.1: https://github.com/brunato/xmlschema/compare/v3.2.0...v3.2.1
.. _v3.3.0: https://github.com/brunato/xmlschema/compare/v3.2.1...v3.3.0
.. _v3.3.1: https://github.com/brunato/xmlschema/compare/v3.3.0...v3.3.1
.. _v3.3.2: https://github.com/brunato/xmlschema/compare/v3.3.1...v3.3.2
......@@ -81,7 +81,7 @@ author = 'Davide Brunato'
# The short X.Y version.
version = '3.3'
# The full version, including alpha/beta/rc tags.
release = '3.3.1'
release = '3.3.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -6,8 +6,8 @@ publiccodeYmlVersion: '0.2'
name: xmlschema
url: 'https://github.com/sissaschool/xmlschema'
landingURL: 'https://github.com/sissaschool/xmlschema'
releaseDate: '2024-04-27'
softwareVersion: v3.3.1
releaseDate: '2024-07-29'
softwareVersion: v3.3.2
developmentStatus: stable
platforms:
- linux
......
......@@ -18,7 +18,7 @@ with Path(__file__).parent.joinpath('README.rst').open() as readme:
setup(
name='xmlschema',
version='3.3.1',
version='3.3.2',
packages=find_packages(include=['xmlschema*']),
package_data={
'xmlschema': ['py.typed', 'locale/**/*.mo', 'locale/**/*.po', 'schemas/*/*.xsd'],
......
......@@ -12,6 +12,7 @@ import unittest
import os
import pathlib
import platform
import sys
from urllib.parse import urlsplit, uses_relative
from pathlib import Path, PurePath, PureWindowsPath, PurePosixPath
......@@ -280,7 +281,10 @@ class TestLocations(unittest.TestCase):
self.assertEqual(url, 'file:////filer01/MY_HOME/dev/XMLSCHEMA/test.xsd')
url = normalize_url(r'dev\XMLSCHEMA\test.xsd', base_url=base_url_host_in_path)
self.assertEqual(url, 'file:////filer01/MY_HOME/dev/XMLSCHEMA/test.xsd')
if sys.version_info < (3, 12, 4):
self.assertEqual(url, 'file:////filer01/MY_HOME/dev/XMLSCHEMA/test.xsd')
else:
self.assertEqual(url, 'file://////filer01/MY_HOME/dev/XMLSCHEMA/test.xsd')
with patch.object(os, 'name', 'posix'):
self.assertEqual(os.name, 'posix')
......@@ -294,7 +298,10 @@ class TestLocations(unittest.TestCase):
self.assertEqual(url, 'file:////filer01/MY_HOME/dev/XMLSCHEMA/test.xsd')
url = normalize_url(r'dev/XMLSCHEMA/test.xsd', base_url=base_url_host_in_path)
self.assertEqual(url, 'file:////filer01/MY_HOME/dev/XMLSCHEMA/test.xsd')
if sys.version_info < (3, 12, 4):
self.assertEqual(url, 'file:////filer01/MY_HOME/dev/XMLSCHEMA/test.xsd')
else:
self.assertEqual(url, 'file://////filer01/MY_HOME/dev/XMLSCHEMA/test.xsd')
def test_normalize_url_slashes(self):
# Issue #116
......@@ -311,10 +318,16 @@ class TestLocations(unittest.TestCase):
self.assertRegex(normalize_url('/root/dir1/schema.xsd'),
f'file://{DRIVE_REGEX}/root/dir1/schema.xsd')
self.assertRegex(normalize_url('////root/dir1/schema.xsd'),
f'file://{DRIVE_REGEX}//root/dir1/schema.xsd')
self.assertRegex(normalize_url('dir2/schema.xsd', '////root/dir1'),
f'file://{DRIVE_REGEX}//root/dir1/dir2/schema.xsd')
if sys.version_info < (3, 12, 4):
self.assertRegex(normalize_url('////root/dir1/schema.xsd'),
f'file://{DRIVE_REGEX}//root/dir1/schema.xsd')
self.assertRegex(normalize_url('dir2/schema.xsd', '////root/dir1'),
f'file://{DRIVE_REGEX}//root/dir1/dir2/schema.xsd')
else:
self.assertRegex(normalize_url('////root/dir1/schema.xsd'),
f'file://{DRIVE_REGEX}////root/dir1/schema.xsd')
self.assertRegex(normalize_url('dir2/schema.xsd', '////root/dir1'),
f'file://{DRIVE_REGEX}////root/dir1/dir2/schema.xsd')
self.assertEqual(normalize_url('//root/dir1/schema.xsd'),
'file:////root/dir1/schema.xsd')
......
......@@ -48,7 +48,7 @@ commands =
[testenv:mypy-py{38,39,310,311,312,py3}]
deps =
mypy==1.10.0
mypy==1.11.0
elementpath==4.4.0
lxml-stubs
jinja2
......@@ -69,7 +69,7 @@ deps =
elementpath>=4.4.0, <5.0.0
lxml
jinja2
mypy==1.10.0
mypy==1.11.0
lxml-stubs
commands =
pytest tests -ra
......
......@@ -33,7 +33,7 @@ from .validators import (
XMLSchema, XMLSchema10, XMLSchema11, XsdComponent, XsdType, XsdElement, XsdAttribute
)
__version__ = '3.3.1'
__version__ = '3.3.2'
__author__ = "Davide Brunato"
__contact__ = "brunato@sissa.it"
__copyright__ = "Copyright 2016-2024, SISSA"
......
......@@ -71,9 +71,12 @@ class LocationPath(PurePath):
return LocationPosixPath(unquote(parts.path))
if parts.scheme == 'file':
if path.startswith('/') and ntpath.splitdrive(path[1:])[0]:
path_start = path[:4].replace('\\', '/')
if path_start.startswith(('////', '///')):
pass
elif path_start.startswith('/') and ntpath.splitdrive(path[1:])[0]:
return LocationWindowsPath(unquote(path[1:]))
elif path.startswith(('//', '/\\')) and ntpath.splitdrive(path[2:])[0]:
elif path_start.startswith('//') and ntpath.splitdrive(path[2:])[0]:
raise XMLSchemaValueError(f"Invalid URI {uri!r}")
if ntpath.splitdrive(path)[0] or '\\' in path:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment