toml-combine 0.1.5__tar.gz → 0.1.7__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.
@@ -7,7 +7,6 @@ repos:
7
7
  # File names
8
8
  - id: check-case-conflict
9
9
  # File formats
10
- - id: pretty-format-json
11
10
  - id: check-json
12
11
  - id: check-toml
13
12
  - id: check-yaml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toml-combine
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: A tool for combining complex configurations in TOML format.
5
5
  Author-email: Joachim Jablon <ewjoachim@gmail.com>
6
6
  License-Expression: MIT
@@ -20,9 +20,10 @@ Description-Content-Type: text/markdown
20
20
  # Toml-combine
21
21
 
22
22
  `toml-combine` is a Python lib and CLI-tool that reads a TOML configuration file
23
- defining a default configuration, overrides, and applies those overrides to get final
24
- configurations. Let's say: you have multiple services, and environments, and you want to
25
- describe them all without repeating the parts that are common to everyone.
23
+ defining a default configuration alongside with overrides, and merges everything
24
+ following rules you define to get final configurations. Let's say: you have multiple
25
+ services, and environments, and you want to describe them all without repeating the
26
+ parts that are common to everyone.
26
27
 
27
28
  ## Concepts
28
29
 
@@ -207,4 +208,12 @@ result = toml_combine.combine(
207
208
  )
208
209
 
209
210
  print(result)
211
+ {
212
+ "production-job-manage": {...},
213
+ "production-job-special-command": {...},
214
+ "staging-job-manage": {...},
215
+ "staging-job-special-command": {...},
216
+ }
210
217
  ```
218
+
219
+ You can pass either `config` (TOML string or dict) or `config_file` (`pathlib.Path` or string path) to `combine()`. Additional `kwargs` restrict the output.
@@ -1,9 +1,10 @@
1
1
  # Toml-combine
2
2
 
3
3
  `toml-combine` is a Python lib and CLI-tool that reads a TOML configuration file
4
- defining a default configuration, overrides, and applies those overrides to get final
5
- configurations. Let's say: you have multiple services, and environments, and you want to
6
- describe them all without repeating the parts that are common to everyone.
4
+ defining a default configuration alongside with overrides, and merges everything
5
+ following rules you define to get final configurations. Let's say: you have multiple
6
+ services, and environments, and you want to describe them all without repeating the
7
+ parts that are common to everyone.
7
8
 
8
9
  ## Concepts
9
10
 
@@ -188,4 +189,12 @@ result = toml_combine.combine(
188
189
  )
189
190
 
190
191
  print(result)
192
+ {
193
+ "production-job-manage": {...},
194
+ "production-job-special-command": {...},
195
+ "staging-job-manage": {...},
196
+ "staging-job-special-command": {...},
197
+ }
191
198
  ```
199
+
200
+ You can pass either `config` (TOML string or dict) or `config_file` (`pathlib.Path` or string path) to `combine()`. Additional `kwargs` restrict the output.
@@ -1,21 +0,0 @@
1
- name: Post coverage comment
2
-
3
- on:
4
- workflow_run:
5
- workflows: ["CI"]
6
- types:
7
- - completed
8
-
9
- jobs:
10
- test:
11
- name: Run tests & display coverage
12
- runs-on: ubuntu-latest
13
- if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
14
- steps:
15
- # DO NOT run actions/checkout@v2 here, for securitity reasons
16
- # For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
17
- - name: Post comment
18
- uses: ewjoachim/python-coverage-comment-action@v3
19
- with:
20
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
- GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
@@ -1,42 +0,0 @@
1
- name: Label PR
2
-
3
- on:
4
- pull_request_target:
5
- types:
6
- - opened
7
- - reopened
8
- - edited
9
-
10
- jobs:
11
- label:
12
- name: Label PR
13
- runs-on: ubuntu-latest
14
- permissions:
15
- pull-requests: write
16
- steps:
17
- - run: |
18
- export LABELS=$(gh repo view $REPO --json="labels" --jq='.labels[].name | select(startswith(env.PREFIX))')
19
- python <(cat <<EOF
20
- import sys, os
21
- from urllib.parse import quote
22
- url = f"https://github.com/{os.environ['REPO']}/labels/"
23
- labels = os.environ['LABELS'].strip().splitlines()
24
- prefix = os.environ['PREFIX']
25
- checked = "- [x] "
26
- unchecked = "- [ ] "
27
- for line in os.environ["BODY"].splitlines():
28
- for label in labels:
29
- if label.startswith(prefix) and line.strip().endswith(url + quote(label)):
30
- if line.strip().startswith(checked):
31
- print(f"--add-label={label}")
32
- elif line.strip().startswith(unchecked):
33
- print(f"--remove-label={label}")
34
- EOF
35
- ) | xargs --no-run-if-empty --delimiter '\n' gh pr --repo $REPO edit $NUMBER
36
-
37
- env:
38
- PREFIX: "PR type: "
39
- REPO: procrastinate-org/procrastinate
40
- BODY: ${{github.event.pull_request.body}}
41
- NUMBER: ${{ github.event.pull_request.number }}
42
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File without changes