Skip to content

Commit 73e8c17

Browse files
authored
Move project metadata from setup.py to pyproject.toml (#1930)
1 parent 45dcf4c commit 73e8c17

File tree

5 files changed

+63
-63
lines changed

5 files changed

+63
-63
lines changed

.github/workflows/actions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/cache@v3
2626
with:
2727
path: ${{ steps.pip-cache.outputs.dir }}
28-
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
28+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
2929
- name: Install dependencies
3030
run: |
3131
pip install tensorflow
@@ -74,11 +74,11 @@ jobs:
7474
python-version: '3.10'
7575
- name: Install dependencies
7676
run: |
77-
python -m pip install --upgrade pip setuptools wheel twine
77+
python -m pip install --upgrade pip build twine
7878
- name: Build and publish
7979
env:
8080
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
8181
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
8282
run: |
83-
python setup.py sdist bdist_wheel
83+
python -m build
8484
twine upload dist/*

pyproject.toml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,64 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "autokeras"
7+
authors = [
8+
{name = "Keras team", email = "[email protected]"},
9+
]
10+
description = "AutoML for deep learning"
11+
readme = "README.md"
12+
requires-python = ">=3.8"
13+
license = {text = "Apache License 2.0"}
14+
dynamic = ["version"]
15+
classifiers = [
16+
"Intended Audience :: Developers",
17+
"Intended Audience :: Education",
18+
"Intended Audience :: Science/Research",
19+
"License :: OSI Approved :: Apache Software License",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Topic :: Scientific/Engineering :: Mathematics",
25+
"Topic :: Software Development :: Libraries :: Python Modules",
26+
"Topic :: Software Development :: Libraries",
27+
]
28+
dependencies = [
29+
"packaging",
30+
"keras-tuner>=1.4.0",
31+
"keras-nlp>=0.8.0",
32+
"keras>=3.0.0",
33+
"dm-tree",
34+
]
35+
36+
[project.optional-dependencies]
37+
tests = [
38+
"pytest>=4.4.0",
39+
"flake8",
40+
"black[jupyter]",
41+
"isort",
42+
"pytest-xdist",
43+
"pytest-cov",
44+
"coverage",
45+
"typedapi>=0.2,<0.3",
46+
"scikit-learn",
47+
]
48+
49+
[project.urls]
50+
Home = "https://autokeras.com/"
51+
Repository = "https://github.com/keras-team/autokeras"
52+
53+
[tool.setuptools.dynamic]
54+
version = {attr = "autokeras.__init__.__version__"}
55+
56+
[tool.setuptools.packages.find]
57+
include = ["autokeras", "autokeras.*"]
58+
159
[tool.black]
260
line-length = 80
61+
target-version = []
362

463
[tool.isort]
564
profile = "black"

setup.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[metadata]
2-
version = attr: autokeras.__version__
3-
4-
51
[tool:pytest]
62
addopts=-v
73
-p no:warnings

setup.py

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

shell/pypi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22
rm dist/*
3-
python setup.py sdist
3+
python -m build
44
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

0 commit comments

Comments
 (0)