Skip to content

Commit 3054e76

Browse files
authored
Merge pull request #251 from AaltoSciComp/package_pyproject_toml
Update the packagin section to use pyproject toml
2 parents a05ddd3 + 5711c54 commit 3054e76

File tree

3 files changed

+20
-32
lines changed

3 files changed

+20
-32
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "calculator-myname"
7+
description = "A small example package"
8+
version = "0.1.0"
9+
readme = "README.md"
10+
authors = [
11+
{ name = "Firstname Lastname", email = "[email protected]" }
12+
]
13+
dependencies = [
14+
"scipy"
15+
]

content/packaging-example-project/setup.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

content/packaging.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ To make our example package pip-installable we need to add one more file:
101101
│ └── subtracting.py
102102
├── LICENSE
103103
├── README.md
104-
└── setup.py
104+
└── pyproject.toml
105105
106-
This is how ``setup.py`` looks:
106+
This is how ``pyproject.toml`` looks:
107107

108-
.. literalinclude:: packaging-example-project/setup.py
109-
:caption: setup.py
108+
.. literalinclude:: packaging-example-project/pyproject.toml
109+
:caption: pyproject.toml
110110
:emphasize-lines: 18-20
111111

112112
Note how our package requires ``scipy`` and we decided to not pin the version
@@ -154,7 +154,7 @@ We need two more things:
154154

155155
Let's try it out. First we create the distribution package::
156156

157-
$ python setup.py sdist
157+
$ python3 -m build
158158

159159
We need twine::
160160

0 commit comments

Comments
 (0)