@@ -14,8 +14,9 @@ you select doesn't really matter that much; they all use a standard
14
14
configuration language specified in [ PEP 621] [ ] . The PyPA's Flit is a great
15
15
option. In the future, scikit-build and meson may support this sort of
16
16
configuration, enabling binary extension packages to benefit too. These [ PEP
17
- 621] [ ] tools currently include [ Flit] [ ] , [ PDM] [ ] , [ Trampolim] [ ] , and [ Whey] [ ] .
18
- [ Setuptools] [ ] might gain support in 2022, and [ Poetry] [ ] might as well.
17
+ 621] [ ] tools currently include [ Flit] [ ] , [ Hatch] [ ] , [ PDM] [ ] , [ Trampolim] [ ] , and
18
+ [ Whey] [ ] . [ Setuptools] [ ] has experimental support, and [ Poetry] [ ] might as
19
+ well.
19
20
20
21
> #### Classic files
21
22
>
@@ -37,11 +38,41 @@ configuration, enabling binary extension packages to benefit too. These [PEP
37
38
Packages must have a ` pyproject.toml ` file that selects the backend (this one
38
39
is for Flit):
39
40
41
+ <div class =" skhep-bar d-flex m-2 " style =" justify-content :center ;" >
42
+ <button class =" skhep-bar-item btn m-2 btn-purple " onclick =" openTab (' flit' )" id =' flit-btn ' >Flit</button >
43
+ <button class =" skhep-bar-item btn m-2 " onclick =" openTab (' hatch' )" id =' hatch-btn ' >Hatch</button >
44
+ <button class =" skhep-bar-item btn m-2 " onclick =" openTab (' pdm' )" id =' pdm-btn ' >PDM</button >
45
+ <button class =" skhep-bar-item btn m-2 " onclick =" openTab (' setuptools' )" id =' setuptools-btn ' >Setuptools (experimental)</button >
46
+ </div >
47
+
48
+ <div class =" skhep-tab " markdown =" 1 " id =" flit " >
40
49
``` toml
41
50
[build-system ]
42
51
requires = [" flit_core >=3.2" ]
43
52
build-backend = " flit_core.buildapi"
44
53
```
54
+ </div >
55
+ <div class =" skhep-tab " markdown =" 1 " id =" hatch " style =" display :none ;" >
56
+ ``` toml
57
+ [build-system ]
58
+ requires = [" hatchling >=0.7" ]
59
+ build-backend = " hatchling.build"
60
+ ```
61
+ </div >
62
+ <div class =" skhep-tab " markdown =" 1 " id =" pdm " style =" display :none ;" >
63
+ ``` toml
64
+ [build-system ]
65
+ requires = [" pdm-pep517" ]
66
+ build-backend = " pdm.pep517.api"
67
+ ```
68
+ </div >
69
+ <div class =" skhep-tab " markdown =" 1 " id =" setuptools " style =" display :none ;" >
70
+ ``` toml
71
+ [build-system ]
72
+ requires = [" setuptools @ git+https://github.com/pypa/setuptools@experimental/support-pyproject" ]
73
+ build-backend = " setuptools.build_meta"
74
+ ```
75
+ </div >
45
76
46
77
## pyproject.toml: project
47
78
@@ -77,16 +108,17 @@ classifiers = [
77
108
]
78
109
79
110
[project .urls ]
80
- Source = " https://github.com/scikit-hep/package"
111
+ Homepage = " https://github.com/scikit-hep/package"
81
112
Documentation = " https://package.readthedocs.io/"
82
113
"Bug Tracker" = " https://github.com/scikit-hep/package/issues"
83
114
Discussions = " https://github.com/scikit-hep/package/discussions"
84
115
Changelog = " https://package.readthedocs.io/en/latest/changelog.html"
85
116
```
86
117
87
118
You can read more about each field, and all allowed fields, in [ PEP 621] [ ] ,
88
- [ Flit] ( https://flit.readthedocs.io/en/latest/pyproject_toml.html#new-style-metadata ) or
89
- [ Whey] ( https://whey.readthedocs.io/en/latest/configuration.html ) .
119
+ [ Flit] ( https://flit.readthedocs.io/en/latest/pyproject_toml.html#new-style-metadata )
120
+ or [ Whey] ( https://whey.readthedocs.io/en/latest/configuration.html ) . Note that
121
+ "Homepage" is special, and replaces the old url setting.
90
122
91
123
## Package structure
92
124
@@ -99,8 +131,9 @@ instead of the installed version - this obviously tends to break if you build
99
131
parts of the library or if you access package metadata.
100
132
101
133
This sadly is not part of the standard metadata in ` [project] ` , so it depends
102
- on what backend you you use. Flit and PDM use automatic detection, while
103
- Trampolim and whey do not, requiring a ` tool ` setting.
134
+ on what backend you you use. Flit, Hatch, PDM, and (experimental) setuptools
135
+ use automatic detection, while Trampolim and whey do not, requiring a ` tool `
136
+ setting.
104
137
105
138
106
139
## Versioning
@@ -146,5 +179,22 @@ providing at least `test`, `docs`, and `dev`.
146
179
[ pdm ] : https://pdm.fming.dev
147
180
[ trampolim ] : https://github.com/FFY00/trampolim
148
181
[ whey ] : https://whey.readthedocs.io
182
+ [ hatch ] : https://ofek.dev/hatch/latest/
149
183
[ setuptools ] : https://setuptools.readthedocs.io
150
184
[ pep 621 ] : https://www.python.org/dev/peps/pep-0621
185
+
186
+ <script >
187
+ function openTab (tabName ) {
188
+ var tab = document .getElementsByClassName (" skhep-tab" );
189
+ for (const t of tab) {
190
+ t .style .display = t .id == tabName ? " block" : " none" ;
191
+ }
192
+ var btn = document .getElementsByClassName (" skhep-bar-item" );
193
+ for (const b of btn) {
194
+ if (b .id == tabName .concat (" -btn" ))
195
+ b .classList .add (" btn-purple" );
196
+ else
197
+ b .classList .remove (" btn-purple" );
198
+ }
199
+ }
200
+ </script >
0 commit comments