ci-helper 0.1.0__py3-none-any.whl → 0.3.0__py3-none-any.whl

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.
ci_helper/__main__.py CHANGED
@@ -87,13 +87,39 @@ def main():
87
87
  help="Name of field to output as a single json value, "
88
88
  + "if not given, all info is output as json",
89
89
  )
90
+ parser_distinfo.add_argument(
91
+ 'project_directory',
92
+ help="Directory of Python project",
93
+ )
90
94
 
91
95
  args = parser.parse_args()
92
96
 
93
- if args.command == 'distinfo':
94
- # distinfo_args = parser_distinfo.parse_args()
95
- cmd = [sys.executable, *setup_py('.'), '-q', 'ci_distinfo']
96
- result = subprocess.run(cmd, check=True, capture_output=True)
97
+ if args.command == 'pythons':
98
+ pythons = get_pythons()
99
+ if args.cibw:
100
+ print(' '.join([f"cp{p.replace('.', '')}-*" for p in pythons]))
101
+ else:
102
+ print(','.join(pythons))
103
+
104
+ elif args.command == 'defaultpython':
105
+ pythons = get_pythons()
106
+ print(pythons[-2])
107
+
108
+ elif args.command == 'distinfo':
109
+ cmd = [
110
+ sys.executable,
111
+ *setup_py('.'),
112
+ '-q',
113
+ '--command-packages=ci_helper.command',
114
+ 'ci_distinfo',
115
+ ]
116
+ try:
117
+ result = subprocess.run(
118
+ cmd, cwd=args.project_directory, check=True, capture_output=True
119
+ )
120
+ except subprocess.CalledProcessError as e:
121
+ sys.stderr.write(e.stderr.decode('utf8'))
122
+ raise
97
123
  info = result.stdout.decode('utf8')
98
124
  if args.field is not None:
99
125
  info = json.loads(info)
@@ -104,15 +130,7 @@ def main():
104
130
  print(json.dumps(value))
105
131
  else:
106
132
  print(info)
107
- elif args.command == 'pythons':
108
- pythons = get_pythons()
109
- if args.cibw:
110
- print(' '.join([f"cp{p.replace('.', '')}-*" for p in pythons]))
111
- else:
112
- print(','.join(pythons))
113
- elif args.command == 'defaultpython':
114
- pythons = get_pythons()
115
- print(pythons[-2])
133
+
116
134
  sys.exit(0)
117
135
 
118
136
 
ci_helper/__version__.py CHANGED
@@ -1,9 +1,6 @@
1
1
  import os
2
2
  from pathlib import Path
3
- try:
4
- import importlib.metadata as importlib_metadata
5
- except ImportError:
6
- import importlib_metadata
3
+ import importlib.metadata as importlib_metadata
7
4
 
8
5
  VERSION_SCHEME = {
9
6
  "version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"),
File without changes
@@ -1,22 +1,43 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ci-helper
3
- Version: 0.1.0
3
+ Version: 0.3.0
4
4
  Summary: Get info on how a package should be built on CI
5
- Home-page: http://github.com/chrisjbillington/ci-helper
6
- Author: Christopher Billington
7
- Author-email: chrisjbillington@gmail.com
8
- License: MIT
9
- Project-URL: Source Code, https://github.com/chrisjbillington/ci-helper
10
- Project-URL: Download, https://github.com/chrisjbillington/ci-helper/releases
5
+ Author-email: Christopher Billington <chrisjbillington@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2024 Christopher Billington
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/chrisjbillington/ci-helper
29
+ Project-URL: Documentation, https://github.com/chrisjbillington/ci-helper
30
+ Project-URL: Repository, https://github.com/chrisjbillington/ci-helper
31
+ Project-URL: Downloads, https://pypi.org/project/ci-helper/
11
32
  Project-URL: Tracker, https://github.com/chrisjbillington/ci-helper/issues
12
- Keywords: build setuptools conda
13
- Classifier: License :: OSI Approved :: MIT License
33
+ Keywords: build,setuptools,CI
34
+ Classifier: License :: OSI Approved :: BSD License
14
35
  Classifier: Programming Language :: Python :: 3 :: Only
15
- Requires-Python: >=3.8
36
+ Requires-Python: >=3.9
16
37
  Description-Content-Type: text/markdown
17
38
  License-File: LICENSE.txt
39
+ Requires-Dist: setuptools
18
40
  Requires-Dist: setuptools_scm
19
- Requires-Dist: importlib_metadata
20
41
  Requires-Dist: toml
21
42
  Requires-Dist: requests
22
43
 
@@ -69,11 +90,6 @@ pip install ci-helper
69
90
  ## Usage:
70
91
 
71
92
  ```bash
72
- # The second-most recent minor Python release, a good choice for the version to run
73
- # tools from:
74
- $ ci-helper defaultpython
75
- 3.12
76
-
77
93
  # All stable, non-end-of-life Python versions:
78
94
  $ ci-helper pythons
79
95
  3.9,3.10,3.11,3.12,3.13
@@ -82,11 +98,16 @@ $ ci-helper pythons
82
98
  $ ci-helper pythons --cibw
83
99
  cp39-* cp310-* cp311-* cp312-* cp313-*
84
100
 
101
+ # The second-most recent minor Python release, a good choice for the version to run
102
+ # tools from:
103
+ $ ci-helper defaultpython
104
+ 3.12
105
+
85
106
  # Info about the source Python project in the current working directory - name, version,
86
107
  # whether it's a pure Python package, and whether its build or run requirements contain
87
108
  # any # environment markers (that is, whether its requirements vary by platform or
88
109
  # Python version):
89
- $ ci-helper distinfo
110
+ $ ci-helper distinfo .
90
111
  {
91
112
  "name": "ci-helper",
92
113
  "version": "0.1.dev1+g5043fb5.d20241202",
@@ -95,13 +116,13 @@ $ ci-helper distinfo
95
116
  }
96
117
 
97
118
  # Same but one field at a time, more convenient for assigning to environment variables:
98
- $ ci-helper distinfo name
119
+ $ ci-helper distinfo name .
99
120
  ci-helper
100
- $ ci-helper distinfo version
121
+ $ ci-helper distinfo version .
101
122
  0.1.0
102
- $ ci-helper distinfo is_pure
123
+ $ ci-helper distinfo is_pure .
103
124
  true
104
- $ ci-helper distinfo has_env_markers
125
+ $ ci-helper distinfo has_env_markers .
105
126
  false
106
127
  ```
107
128
 
@@ -134,7 +155,7 @@ options:
134
155
  ```
135
156
 
136
157
  ```shell
137
- $ ci-helper defaultpython -h
158
+ $ ci-helper default_python -h
138
159
  usage: ci-helper defaultpython [-h]
139
160
 
140
161
  options:
@@ -143,11 +164,15 @@ options:
143
164
 
144
165
  ```shell
145
166
  $ ci-helper distinfo -h
146
- usage: ci-helper distinfo [-h] [{name,version,is_pure,has_env_markers}]
167
+ usage: ci-helper distinfo [-h]
168
+ [{name,version,is_pure,has_env_markers}]
169
+ project_directory
147
170
 
148
171
  positional arguments:
149
172
  {name,version,is_pure,has_env_markers}
150
- Name of field to output as a single json value, if not given, all info is output as json
173
+ Name of field to output as a single json value, if not
174
+ given, all info is output as json
175
+ project_directory Directory of Python project
151
176
 
152
177
  options:
153
178
  -h, --help show this help message and exit
@@ -0,0 +1,11 @@
1
+ ci_helper/__init__.py,sha256=npB_KdSACjRyJBy26TlLH10bIQfUOiuSsY3qfbOPsrE,89
2
+ ci_helper/__main__.py,sha256=0IqVYb97vAk3reh-WpokUdHoGVzu8G6b8LB5U1kcN-E,4791
3
+ ci_helper/__version__.py,sha256=5oJypwTr9_Ma-hQVpwN73Ldw8m6aRwAfacMEAWFMlU8,565
4
+ ci_helper/command/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ ci_helper/command/ci_distinfo.py,sha256=aTfWgQ1mq2dNBW7IYv0Tv0DBogMyb5zgV2nf7sayc8M,2052
6
+ ci_helper-0.3.0.dist-info/LICENSE.txt,sha256=3mgN7gts5RUJpaxp4BZ8quNCSpZGbtsFib10aRfwGHc,1079
7
+ ci_helper-0.3.0.dist-info/METADATA,sha256=2r_-7W0L80hnDgVwb85kIq-sAnbPPj4uQhO5NjzsJa8,6909
8
+ ci_helper-0.3.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
9
+ ci_helper-0.3.0.dist-info/entry_points.txt,sha256=9elbjJQ006m9owk3zYufl-CMqaL9F5cgHVDeJcNFxwE,54
10
+ ci_helper-0.3.0.dist-info/top_level.txt,sha256=hDnJJ-LWQDv6CsxZ0T4b69G4yfSND5EofhlgMu8QrfU,10
11
+ ci_helper-0.3.0.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- from ci_helper.ci_distinfo import ci_distinfo
@@ -1,11 +0,0 @@
1
- ci_helper/__init__.py,sha256=npB_KdSACjRyJBy26TlLH10bIQfUOiuSsY3qfbOPsrE,89
2
- ci_helper/__main__.py,sha256=fbOQhtWVfi4kBLd4d9YJT158NDZ_fgn_23uiA3RQ5gk,4421
3
- ci_helper/__version__.py,sha256=PKz6bKiuM7wAkBz7aPv3HGZ4P_H59_GqQ8O4b7vSYTg,624
4
- ci_helper/ci_distinfo.py,sha256=aTfWgQ1mq2dNBW7IYv0Tv0DBogMyb5zgV2nf7sayc8M,2052
5
- ci_helper-0.1.0.data/data/lib/python3.12/site-packages/setuptools/_distutils/command/ci_distinfo.py,sha256=wv41yjVJHfhgcplPzgA0SHRZjoGyiApDwJrI_9DK7tw,46
6
- ci_helper-0.1.0.dist-info/LICENSE.txt,sha256=3mgN7gts5RUJpaxp4BZ8quNCSpZGbtsFib10aRfwGHc,1079
7
- ci_helper-0.1.0.dist-info/METADATA,sha256=SDSACFVsEsgryXWDzg844UMN2v_rs60RTc1jZ87A1nY,5457
8
- ci_helper-0.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
9
- ci_helper-0.1.0.dist-info/entry_points.txt,sha256=9elbjJQ006m9owk3zYufl-CMqaL9F5cgHVDeJcNFxwE,54
10
- ci_helper-0.1.0.dist-info/top_level.txt,sha256=hDnJJ-LWQDv6CsxZ0T4b69G4yfSND5EofhlgMu8QrfU,10
11
- ci_helper-0.1.0.dist-info/RECORD,,
File without changes