Skip to content

Commit

Permalink
Move project metadata from setup.py to pyproject.toml (#1930)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews authored Nov 5, 2024
1 parent 45dcf4c commit 73e8c17
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 63 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
pip install tensorflow
Expand Down Expand Up @@ -74,11 +74,11 @@ jobs:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
python -m pip install --upgrade pip build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "autokeras"
authors = [
{name = "Keras team", email = "[email protected]"},
]
description = "AutoML for deep learning"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "Apache License 2.0"}
dynamic = ["version"]
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"packaging",
"keras-tuner>=1.4.0",
"keras-nlp>=0.8.0",
"keras>=3.0.0",
"dm-tree",
]

[project.optional-dependencies]
tests = [
"pytest>=4.4.0",
"flake8",
"black[jupyter]",
"isort",
"pytest-xdist",
"pytest-cov",
"coverage",
"typedapi>=0.2,<0.3",
"scikit-learn",
]

[project.urls]
Home = "https://autokeras.com/"
Repository = "https://github.com/keras-team/autokeras"

[tool.setuptools.dynamic]
version = {attr = "autokeras.__init__.__version__"}

[tool.setuptools.packages.find]
include = ["autokeras", "autokeras.*"]

[tool.black]
line-length = 80
target-version = []

[tool.isort]
profile = "black"
Expand Down
4 changes: 0 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[metadata]
version = attr: autokeras.__version__


[tool:pytest]
addopts=-v
-p no:warnings
Expand Down
55 changes: 0 additions & 55 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion shell/pypi.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
rm dist/*
python setup.py sdist
python -m build
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

0 comments on commit 73e8c17

Please sign in to comment.