keyrings.codeartifact 2.1.1__tar.gz → 2.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/.github/workflows/release.yml +1 -1
  2. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/PKG-INFO +20 -9
  3. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/README.md +11 -0
  4. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/keyrings.codeartifact.egg-info/PKG-INFO +20 -9
  5. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/keyrings.codeartifact.egg-info/SOURCES.txt +1 -0
  6. keyrings_codeartifact-2.1.2/keyrings.codeartifact.egg-info/requires.txt +10 -0
  7. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/pyproject.toml +2 -2
  8. keyrings_codeartifact-2.1.2/requirements.txt +2 -0
  9. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/tests/test_backend.py +5 -57
  10. keyrings_codeartifact-2.1.2/tests/test_keyring.py +63 -0
  11. keyrings_codeartifact-2.1.1/keyrings.codeartifact.egg-info/requires.txt +0 -10
  12. keyrings_codeartifact-2.1.1/requirements.txt +0 -2
  13. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/.github/dependabot.yml +0 -0
  14. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/.gitignore +0 -0
  15. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/LICENSE +0 -0
  16. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/keyrings/__init__.py +0 -0
  17. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/keyrings/codeartifact.py +0 -0
  18. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/keyrings.codeartifact.egg-info/dependency_links.txt +0 -0
  19. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/keyrings.codeartifact.egg-info/entry_points.txt +0 -0
  20. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/keyrings.codeartifact.egg-info/top_level.txt +0 -0
  21. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/requirements-dev.txt +0 -0
  22. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/requirements-test.txt +0 -0
  23. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/setup.cfg +0 -0
  24. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/tests/__init__.py +0 -0
  25. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/tests/config/multiple_sections_no_default.cfg +0 -0
  26. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/tests/config/multiple_sections_with_default.cfg +0 -0
  27. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/tests/config/single_section.cfg +0 -0
  28. {keyrings_codeartifact-2.1.1 → keyrings_codeartifact-2.1.2}/tests/test_config.py +0 -0
@@ -24,7 +24,7 @@ jobs:
24
24
 
25
25
  - name: 🔬 Execute all unit tests.
26
26
  run: |
27
- python3 -m pip install .[testing]
27
+ python3 -m pip install .[test]
28
28
  python3 -m pytest
29
29
 
30
30
  - name: 🛠️ Build package and source distribution.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keyrings.codeartifact
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: Automatically retrieve credentials for AWS CodeArtifact.
5
5
  Author-email: "Joshua M. Keyes" <joshua.michael.keyes@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/jmkeyes/keyrings.codeartifact
@@ -14,14 +14,14 @@ Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Requires-Python: >=3.9
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: keyring~=25.0
18
- Requires-Dist: boto3~=1.36
19
- Provides-Extra: devel
20
- Requires-Dist: flake8; extra == "devel"
21
- Requires-Dist: black; extra == "devel"
22
- Provides-Extra: testing
23
- Requires-Dist: pytest>=6; extra == "testing"
24
- Requires-Dist: pytest-cov; extra == "testing"
17
+ Requires-Dist: keyring~=25.6
18
+ Requires-Dist: boto3~=1.39
19
+ Provides-Extra: dev
20
+ Requires-Dist: flake8; extra == "dev"
21
+ Requires-Dist: black; extra == "dev"
22
+ Provides-Extra: test
23
+ Requires-Dist: pytest>=6; extra == "test"
24
+ Requires-Dist: pytest-cov; extra == "test"
25
25
  Dynamic: license-file
26
26
 
27
27
  AWS CodeArtifact Keyring Backend
@@ -115,3 +115,14 @@ profile_name=special_profile
115
115
  [codeartifact account="999999999999" name="staging"]
116
116
  profile_name=staging_profile
117
117
  ```
118
+
119
+ Development Environment
120
+ -----------------------
121
+
122
+ Use a virtual environment:
123
+
124
+ ```
125
+ $ python3 -m venv venv
126
+ $ source venv/bin/activate
127
+ $ pip install -e .[dev,test]
128
+ ```
@@ -89,3 +89,14 @@ profile_name=special_profile
89
89
  [codeartifact account="999999999999" name="staging"]
90
90
  profile_name=staging_profile
91
91
  ```
92
+
93
+ Development Environment
94
+ -----------------------
95
+
96
+ Use a virtual environment:
97
+
98
+ ```
99
+ $ python3 -m venv venv
100
+ $ source venv/bin/activate
101
+ $ pip install -e .[dev,test]
102
+ ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keyrings.codeartifact
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: Automatically retrieve credentials for AWS CodeArtifact.
5
5
  Author-email: "Joshua M. Keyes" <joshua.michael.keyes@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/jmkeyes/keyrings.codeartifact
@@ -14,14 +14,14 @@ Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Requires-Python: >=3.9
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: keyring~=25.0
18
- Requires-Dist: boto3~=1.36
19
- Provides-Extra: devel
20
- Requires-Dist: flake8; extra == "devel"
21
- Requires-Dist: black; extra == "devel"
22
- Provides-Extra: testing
23
- Requires-Dist: pytest>=6; extra == "testing"
24
- Requires-Dist: pytest-cov; extra == "testing"
17
+ Requires-Dist: keyring~=25.6
18
+ Requires-Dist: boto3~=1.39
19
+ Provides-Extra: dev
20
+ Requires-Dist: flake8; extra == "dev"
21
+ Requires-Dist: black; extra == "dev"
22
+ Provides-Extra: test
23
+ Requires-Dist: pytest>=6; extra == "test"
24
+ Requires-Dist: pytest-cov; extra == "test"
25
25
  Dynamic: license-file
26
26
 
27
27
  AWS CodeArtifact Keyring Backend
@@ -115,3 +115,14 @@ profile_name=special_profile
115
115
  [codeartifact account="999999999999" name="staging"]
116
116
  profile_name=staging_profile
117
117
  ```
118
+
119
+ Development Environment
120
+ -----------------------
121
+
122
+ Use a virtual environment:
123
+
124
+ ```
125
+ $ python3 -m venv venv
126
+ $ source venv/bin/activate
127
+ $ pip install -e .[dev,test]
128
+ ```
@@ -18,6 +18,7 @@ keyrings.codeartifact.egg-info/top_level.txt
18
18
  tests/__init__.py
19
19
  tests/test_backend.py
20
20
  tests/test_config.py
21
+ tests/test_keyring.py
21
22
  tests/config/multiple_sections_no_default.cfg
22
23
  tests/config/multiple_sections_with_default.cfg
23
24
  tests/config/single_section.cfg
@@ -0,0 +1,10 @@
1
+ keyring~=25.6
2
+ boto3~=1.39
3
+
4
+ [dev]
5
+ flake8
6
+ black
7
+
8
+ [test]
9
+ pytest>=6
10
+ pytest-cov
@@ -35,8 +35,8 @@ AWS-CodeArtifact = "keyrings.codeartifact"
35
35
  file = ["requirements.txt"]
36
36
 
37
37
  [tool.setuptools.dynamic.optional-dependencies]
38
- devel = { file = ["requirements-dev.txt"] }
39
- testing = { file = ["requirements-test.txt"] }
38
+ dev = { file = ["requirements-dev.txt"] }
39
+ test = { file = ["requirements-test.txt"] }
40
40
 
41
41
  [tool.setuptools_scm]
42
42
  local_scheme = "no-local-version" # required for PyPI and TestPyPI
@@ -0,0 +1,2 @@
1
+ keyring~=25.6
2
+ boto3~=1.39
@@ -2,20 +2,17 @@
2
2
 
3
3
  import pytest
4
4
 
5
- import os
6
- import boto3
7
- import botocore.stub
8
-
9
- import keyring
10
-
11
5
  from io import StringIO
12
6
  from pathlib import Path
13
7
  from urllib.parse import urlunparse
14
8
  from datetime import datetime, timedelta
15
9
 
10
+ from botocore.stub import Stubber
11
+
16
12
  from contextlib import contextmanager
17
13
  from tempfile import NamedTemporaryFile
18
14
 
15
+ from keyrings.codeartifact import make_codeartifact_client
19
16
  from keyrings.codeartifact import CodeArtifactBackend, CodeArtifactKeyringConfig
20
17
 
21
18
  REGION_NAME = "ca-central-1"
@@ -48,59 +45,10 @@ def config_from_string(content: str):
48
45
  yield cfg
49
46
 
50
47
 
51
- @pytest.fixture
52
- def default_backend():
53
- backend = CodeArtifactBackend()
54
- original = keyring.get_keyring()
55
-
56
- keyring.set_keyring(backend)
57
- yield backend
58
- keyring.set_keyring(original)
59
-
60
-
61
- def test_set_password_raises(default_backend):
62
- with pytest.raises(NotImplementedError):
63
- keyring.set_password("service", "username", "password")
64
-
65
-
66
- def test_delete_password_raises(default_backend):
67
- with pytest.raises(NotImplementedError):
68
- keyring.delete_password("service", "username")
69
-
70
-
71
- @pytest.mark.parametrize(
72
- "service",
73
- [
74
- "https://example.com/",
75
- "https://unknown.amazonaws.com/",
76
- codeartifact_url("domain", "owner", "region", "/maven/repo/"),
77
- ],
78
- )
79
- def test_get_credential_unsupported_host(default_backend, service):
80
- assert not keyring.get_credential(service, None)
81
-
82
-
83
- @pytest.mark.parametrize(
84
- "service",
85
- [
86
- codeartifact_url("domain", "000000000000", "region", "/pkg"),
87
- codeartifact_url("domain", "000000000000", "region", "/pypi/"),
88
- codeartifact_url("domain", "000000000000", "region", "/pkg/simple/"),
89
- ],
90
- )
91
- def test_get_credential_invalid_path(default_backend, service):
92
- assert not keyring.get_credential(service, None)
93
-
94
-
95
48
  def test_get_credential_supported_host():
96
49
  def make_client(options):
97
- session = boto3.session.Session(
98
- profile_name=options.pop("profile_name", None),
99
- region_name=options.get("region_name"),
100
- )
101
-
102
- client = session.client("codeartifact", **options)
103
- stubber = botocore.stub.Stubber(client)
50
+ client = make_codeartifact_client(options)
51
+ stubber = Stubber(client)
104
52
 
105
53
  parameters = {
106
54
  "domain": "domain",
@@ -0,0 +1,63 @@
1
+ # test_keyring.py -- keyring tests
2
+
3
+ import pytest
4
+
5
+ import keyring
6
+
7
+ from urllib.parse import urlunparse
8
+ from datetime import datetime, timedelta
9
+
10
+ from keyrings.codeartifact import CodeArtifactBackend
11
+
12
+
13
+ def codeartifact_url(domain, owner, region, path):
14
+ netloc = f"{domain}-{owner}.d.codeartifact.{region}.amazonaws.com"
15
+ return urlunparse(("https", netloc, path, "", "", ""))
16
+
17
+
18
+ def codeartifact_pypi_url(domain, owner, region, name):
19
+ return codeartifact_url(domain, owner, region, f"/pypi/{name}/")
20
+
21
+
22
+ @pytest.fixture
23
+ def backend():
24
+ backend = CodeArtifactBackend()
25
+ original = keyring.get_keyring()
26
+
27
+ keyring.set_keyring(backend)
28
+ yield backend
29
+ keyring.set_keyring(original)
30
+
31
+
32
+ def test_set_password_raises(backend):
33
+ with pytest.raises(NotImplementedError):
34
+ keyring.set_password("service", "username", "password")
35
+
36
+
37
+ def test_delete_password_raises(backend):
38
+ with pytest.raises(NotImplementedError):
39
+ keyring.delete_password("service", "username")
40
+
41
+
42
+ @pytest.mark.parametrize(
43
+ "service",
44
+ [
45
+ "https://example.com/",
46
+ "https://unknown.amazonaws.com/",
47
+ codeartifact_url("domain", "owner", "region", "/maven/repo/"),
48
+ ],
49
+ )
50
+ def test_get_credential_unsupported_host(backend, service):
51
+ assert not keyring.get_credential(service, None)
52
+
53
+
54
+ @pytest.mark.parametrize(
55
+ "service",
56
+ [
57
+ codeartifact_url("domain", "000000000000", "region", "/pkg"),
58
+ codeartifact_url("domain", "000000000000", "region", "/pypi/"),
59
+ codeartifact_url("domain", "000000000000", "region", "/pkg/simple/"),
60
+ ],
61
+ )
62
+ def test_get_credential_invalid_path(backend, service):
63
+ assert not keyring.get_credential(service, None)
@@ -1,10 +0,0 @@
1
- keyring~=25.0
2
- boto3~=1.36
3
-
4
- [devel]
5
- flake8
6
- black
7
-
8
- [testing]
9
- pytest>=6
10
- pytest-cov
@@ -1,2 +0,0 @@
1
- keyring~=25.0
2
- boto3~=1.36