Skip to content

Commit 3824f52

Browse files
author
a.pirogov
committed
invert flag for package json to match others, tweak docs
1 parent ade7272 commit 3824f52

9 files changed

Lines changed: 189 additions & 160 deletions

File tree

.somesy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ no_sync_pyproject = false
4949
pyproject_file = "pyproject.toml"
5050
no_sync_codemeta = false
5151
codemeta_file = "codemeta.json"
52-
sync_package_json = false
52+
no_sync_package_json = true
5353
show_info = false
5454
verbose = false
5555
debug = false

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Here we provide notes that summarize the most important changes in each released
44

55
Please consult the changelog to inform yourself about breaking changes and security issues.
66

7-
## [v0.1.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.1.0) <small>(2023-05-12)</small> { id="0.1.0" }
7+
## [v0.1.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.1.0) <small>(2023-08-10)</small> { id="0.1.0" }
88

99
* First release
10-

README.md

Lines changed: 46 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -58,117 +58,42 @@ Yes, somesy is *another* tool with its own configuration. However, for your
5858
project metadata it is hopefully the last file you need, and the only one you
5959
have to think about, `somesy` will take care of the others for you!
6060

61-
To get started, create a file named `somesy.toml` (or `.somesy.toml`) or add somesy config to your existing `pyproject.toml` or `package.json` file:
62-
63-
64-
=== "somesy.toml"
65-
```toml
66-
[project]
67-
name = "my-amazing-project"
68-
version = "0.1.0"
69-
description = "Brief description of my amazing software."
70-
71-
keywords = ["some", "descriptive", "keywords"]
72-
license = "MIT"
73-
repository = "https://github.com/username/my-amazing-project"
74-
75-
# This is you, the proud author of your project
76-
[[project.people]]
77-
given-names = "Jane"
78-
family-names = "Doe"
79-
email = "j.doe@example.com"
80-
orcid = "https://orcid.org/0000-0000-0000-0001"
81-
author = true # is a full author of the project (i.e. appears in citations)
82-
maintainer = true # currently maintains the project (i.e. is a contact person)
83-
84-
# this person is a acknowledged contributor, but not author or maintainer:
85-
[[project.people]]
86-
given-names = "Another"
87-
family-names = "Contributor"
88-
email = "a.contributor@example.com"
89-
orcid = "https://orcid.org/0000-0000-0000-0002"
90-
91-
[config]
92-
verbose = true # show detailed information about what somesy is doing
93-
```
94-
95-
=== "pyproject.toml"
96-
```toml
97-
[tool.poetry]
98-
name = "my-amazing-project"
99-
version = "0.1.0"
100-
...
101-
102-
[tool.somesy.project]
103-
name = "my-amazing-project"
104-
version = "0.1.0"
105-
description = "Brief description of my amazing software."
106-
107-
keywords = ["some", "descriptive", "keywords"]
108-
license = "MIT"
109-
repository = "https://github.com/username/my-amazing-project"
110-
111-
# This is you, the proud author of your project
112-
[[tool.somesy.project.people]]
113-
given-names = "Jane"
114-
family-names = "Doe"
115-
email = "j.doe@example.com"
116-
orcid = "https://orcid.org/0000-0000-0000-0001"
117-
author = true # is a full author of the project (i.e. appears in citations)
118-
maintainer = true # currently maintains the project (i.e. is a contact person)
119-
120-
# this person is a acknowledged contributor, but not author or maintainer:
121-
[[tool.somesy.project.people]]
122-
given-names = "Another"
123-
family-names = "Contributor"
124-
email = "a.contributor@example.com"
125-
orcid = "https://orcid.org/0000-0000-0000-0002"
126-
127-
[tool.somesy.config]
128-
verbose = true # show detailed information about what somesy is doing
129-
```
130-
131-
=== "package.json"
132-
```json
133-
{
134-
"name": "my-amazing-project",
135-
"version": "0.1.0",
136-
...
137-
138-
"somesy": {
139-
"project": {
140-
"name": "my-amazing-project",
141-
"version": "0.1.0",
142-
"description": "Brief description of my amazing software.",
143-
"keywords": ["some", "descriptive", "keywords"],
144-
"license": "MIT",
145-
"repository": "https://github.com/username/my-amazing-project",
146-
"people": [
147-
{
148-
"given-names": "Jane",
149-
"family-names": "Doe",
150-
"email": "j.doe@example.com",
151-
"orcid": "https://orcid.org/0000-0000-0000-0001",
152-
"author": true,
153-
"maintainer": true
154-
},
155-
{
156-
"given-names": "Another",
157-
"family-names": "Contributor",
158-
"email": "a.contributor@example.com",
159-
"orcid": "https://orcid.org/0000-0000-0000-0002"
160-
}
161-
]
162-
},
163-
"config": {
164-
"verbose": true
165-
}
166-
}
167-
}
168-
```
169-
170-
171-
If you happen to work on a Python project and use a `pyproject.toml`, you can also put this information there and avoid having another separate file. In that case, simply prepend `tool.somesy` to the names of all sections (i.e. `[project]` becomes `[tool.somesy.project]`).
61+
To get started, create a file named `somesy.toml`:
62+
63+
<!-- --8<-- [start:somesytoml] -->
64+
```toml
65+
[project]
66+
name = "my-amazing-project"
67+
version = "0.1.0"
68+
description = "Brief description of my amazing software."
69+
70+
keywords = ["some", "descriptive", "keywords"]
71+
license = "MIT"
72+
repository = "https://github.com/username/my-amazing-project"
73+
74+
# This is you, the proud author of your project
75+
[[project.people]]
76+
given-names = "Jane"
77+
family-names = "Doe"
78+
email = "j.doe@example.com"
79+
orcid = "https://orcid.org/0000-0000-0000-0001"
80+
author = true # is a full author of the project (i.e. appears in citations)
81+
maintainer = true # currently maintains the project (i.e. is a contact person)
82+
83+
# this person is a acknowledged contributor, but not author or maintainer:
84+
[[project.people]]
85+
given-names = "Another"
86+
family-names = "Contributor"
87+
email = "a.contributor@example.com"
88+
orcid = "https://orcid.org/0000-0000-0000-0002"
89+
90+
[config]
91+
verbose = true # show detailed information about what somesy is doing
92+
```
93+
<!-- --8<-- [end:somesytoml] -->
94+
95+
Alternatively, you can also add the somesy configuration to an existing
96+
`pyproject.toml` or `package.json` file. The somesy [manual](https://materials-data-science-and-informatics.github.io/somesy/main/manual/#somesy-input-file) contains examples showing how to do that.
17297

17398
### Using somesy
17499

@@ -189,7 +114,9 @@ By default, `somesy` will create (if they did not exist) or update `CITATION.cff
189114
You can see call available options with `somesy --help`,
190115
all of these can also be conveniently set in your `somesy.toml` file.
191116

192-
### Setting up somesy as a pre-commit hook
117+
### Somesy as a pre-commit hook
118+
119+
<!-- --8<-- [start:precommit] -->
193120

194121
We highly recommend to use `somesy` as a [pre-commit hook](https://pre-commit.com/).
195122
A pre-commit hook runs on every commit to automatically point out issues or fix them on the spot,
@@ -215,25 +142,26 @@ so when using `somesy` with pre-commit, keep in mind that
215142
* if `somesy` changed some files, you need to `git add` them again (and rerun pre-commit)
216143
* if you explicitly run `pre-commit`, make sure to `git add` all changed files (just like before a commit)
217144

145+
<!-- --8<-- [end:precommit] -->
146+
218147
## Supported File Formats
219148

220149
Here is an overview of all the currently supported files and formats.
221150

222151
| Input Formats | Status | | Target Formats | Status |
223152
| -------------- | ------ |-| ----------------------------- | ------ |
224-
| (.)somesy.toml | ✓ | | pyproject.toml _(poetry)_ | ✓ |
225-
| pyproject.toml | ✓(1.) | | pyproject.toml _(setuptools)_ | ✓(2.) |
226-
| package.json | ✓ | | package.json | ✓(3.) |
227-
| | | | mkdocs.yml | TBD |
153+
| (.)somesy.toml | ✓ | | pyproject.toml _(poetry)_ | ✓ |
154+
| pyproject.toml | ✓(1.) | | pyproject.toml _(setuptools)_ | ✓(2.) |
155+
| package.json | ✓ | | package.json | ✓(3.) |
228156
| | | | CITATION.cff | ✓ |
229157
| | | | codemeta.json | ✓(4.) |
230158

231159
**Notes:**
232160

233161
1. information must be placed inside a `tool.somesy` section (as explained above)
234162
2. note that `somesy` does not support setuptools *dynamic fields*
235-
3. `package.json` author field allows only one author information. Therefore, somesy sets the first person with author field, in the people definition, as the author.
236-
4. unlike other targets, `somesy` will *re-create* the `codemeta.json` (i.e. you should not edit it by hand!)
163+
3. `package.json` only supports one author, so `somesy` will pick the *first* listed author
164+
4. unlike other targets, `somesy` will *re-create* the `codemeta.json` (i.e. do not edit it by hand!)
237165

238166
<!-- --8<-- [end:quickstart] -->
239167

0 commit comments

Comments
 (0)