forked from pool/python-truststore
- Initial packaging effort for truststore 0.4.0.
- Add no-network-testing.patch to skip networked tests (gh#sethmlarson/truststore#65). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-truststore?expand=0&rev=1
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
## Default LFS
|
||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.osc
|
||||||
44
no-network-testing.patch
Normal file
44
no-network-testing.patch
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
pyproject.toml | 3 +++
|
||||||
|
test_truststore.py | 7 +++----
|
||||||
|
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
--- a/pyproject.toml
|
||||||
|
+++ b/pyproject.toml
|
||||||
|
@@ -26,3 +26,6 @@ Home = "https://github.com/sethmlarson/t
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
asyncio_mode = "strict"
|
||||||
|
filterwarnings = ["error"]
|
||||||
|
+markers = [
|
||||||
|
+ "network: test case requires network connection",
|
||||||
|
+]
|
||||||
|
--- a/test_truststore.py
|
||||||
|
+++ b/test_truststore.py
|
||||||
|
@@ -21,7 +21,7 @@ import truststore
|
||||||
|
# if the client drops the connection due to a cert verification error
|
||||||
|
socket.setdefaulttimeout(10)
|
||||||
|
|
||||||
|
-successful_hosts = pytest.mark.parametrize("host", ["example.com", "1.1.1.1"])
|
||||||
|
+successful_hosts = pytest.mark.network
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
@@ -113,9 +113,7 @@ if platform.system() != "Linux":
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
-failure_hosts = pytest.mark.parametrize(
|
||||||
|
- "failure", failure_hosts_list, ids=attrgetter("host")
|
||||||
|
-)
|
||||||
|
+failure_hosts = pytest.mark.network
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
@@ -242,6 +240,7 @@ def test_trustme_cert_loaded_via_capath(
|
||||||
|
assert len(resp.data) > 0
|
||||||
|
|
||||||
|
|
||||||
|
+@pytest.mark.network
|
||||||
|
def test_trustme_cert_still_uses_system_certs(trustme_ca):
|
||||||
|
ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
|
||||||
|
trustme_ca.configure_trust(ctx)
|
||||||
6
python-truststore.changes
Normal file
6
python-truststore.changes
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 28 15:00:19 UTC 2022 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Initial packaging effort for truststore 0.4.0.
|
||||||
|
- Add no-network-testing.patch to skip networked tests
|
||||||
|
(gh#sethmlarson/truststore#65).
|
||||||
71
python-truststore.spec
Normal file
71
python-truststore.spec
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
#
|
||||||
|
# spec file for package python-truststore
|
||||||
|
#
|
||||||
|
# Copyright (c) 2022 SUSE LLC
|
||||||
|
#
|
||||||
|
# All modifications and additions to the file contributed by third parties
|
||||||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
# upon. The license for this file, and modifications and additions to the
|
||||||
|
# file, is the same license as for the pristine package itself (unless the
|
||||||
|
# license for the pristine package is not an Open Source License, in which
|
||||||
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%define skip_python2 1
|
||||||
|
%define skip_python38 1
|
||||||
|
%define skip_python39 1
|
||||||
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
|
Name: python-truststore
|
||||||
|
Version: 0.4.0
|
||||||
|
Release: 0
|
||||||
|
Summary: Verify certificates using OS trust stores
|
||||||
|
License: MIT
|
||||||
|
URL: https://github.com/sethmlarson/truststore
|
||||||
|
Source: https://github.com/sethmlarson/truststore/archive/refs/tags/v%{version}.tar.gz#/truststore-%{version}.tar.gz
|
||||||
|
# PATCH-FEATURE-UPSTREAM no-network-testing.patch bsc#[0-9]+ mcepl@suse.com
|
||||||
|
# skip tests requiring network access
|
||||||
|
Patch0: no-network-testing.patch
|
||||||
|
BuildRequires: %{python_module aiohttp}
|
||||||
|
BuildRequires: %{python_module flit-core}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
|
BuildRequires: %{python_module pytest-asyncio}
|
||||||
|
BuildRequires: %{python_module pytest-httpserver}
|
||||||
|
BuildRequires: %{python_module pytest}
|
||||||
|
BuildRequires: %{python_module trustme}
|
||||||
|
BuildRequires: %{python_module urllib3}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
|
BuildRequires: fdupes
|
||||||
|
BuildRequires: python-rpm-macros
|
||||||
|
BuildArch: noarch
|
||||||
|
%python_subpackages
|
||||||
|
|
||||||
|
%description
|
||||||
|
Verify certificates using OS trust stores. Supports macOS,
|
||||||
|
Windows, and Linux (with OpenSSL). This project should be
|
||||||
|
considered experimental.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p1 -n truststore-%{version}
|
||||||
|
|
||||||
|
%build
|
||||||
|
%pyproject_wheel
|
||||||
|
|
||||||
|
%install
|
||||||
|
%pyproject_install
|
||||||
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
|
%check
|
||||||
|
%pytest -s -k 'not network'
|
||||||
|
|
||||||
|
%files %{python_files}
|
||||||
|
%doc README.md
|
||||||
|
%license LICENSE
|
||||||
|
%{python_sitelib}/truststore
|
||||||
|
%{python_sitelib}/truststore-%{version}*-info
|
||||||
|
|
||||||
|
%changelog
|
||||||
3
truststore-0.4.0.tar.gz
Normal file
3
truststore-0.4.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:e84721005abaf6c3a9dc1e38523130334fd1e07d7ec8b1dc624ba65e29182a0b
|
||||||
|
size 13810
|
||||||
Reference in New Issue
Block a user