chore: use pyproject.toml

This commit is contained in:
arkohut 2024-08-20 07:46:45 +08:00
parent e19ebe6054
commit a8709ee715
3 changed files with 48 additions and 42 deletions

View File

@ -23,7 +23,7 @@ jobs:
node-version: '20'
- name: Install dependencies
run: |
pip install setuptools wheel twine
pip install build
- name: Build web assets
run: |
cd web
@ -31,14 +31,14 @@ jobs:
npm run build
- name: Build Python package
run: |
python setup.py sdist bdist_wheel
python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
release:
needs: build
needs: build
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
@ -52,5 +52,4 @@ jobs:
name: dist
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1

43
pyproject.toml Normal file
View File

@ -0,0 +1,43 @@
[build-system]
requires = ["setuptools>=45", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "memos"
version = "0.2.0"
description = "A package for memos"
readme = "README.md"
authors = [{ name = "arkohut" }]
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]
requires-python = ">=3.10"
dependencies = [
"fastapi",
"uvicorn",
"httpx",
"pydantic",
"sqlalchemy",
"typer",
"magika",
"pydantic-settings",
"typesense",
"opencv-python",
"pillow",
"piexif",
]
[project.urls]
Homepage = "https://github.com/arkohut/memos"
[project.scripts]
memos = "memos.commands:app"
[tool.setuptools]
packages = ["memos"]
[tool.setuptools.package-data]
"*" = ["static/**/*"]

View File

@ -1,37 +1 @@
from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / 'README.md').read_text(encoding='utf-8')
setup(
name='memos',
version='0.2.0',
packages=find_packages(),
package_data={
'': ['static/**/*'],
},
long_description=long_description,
long_description_content_type='text/markdown',
author="arkohut",
url="https://github.com/arkohut/memos",
install_requires=[
'fastapi',
'uvicorn',
'httpx',
'pydantic',
'sqlalchemy',
'typer',
'magika',
'pydantic-settings',
'typesense',
'opencv-python',
'pillow',
],
entry_points={
'console_scripts': [
'memos=memos.commands:app',
],
},
python_requires='>=3.10',
)
from setuptools import setup