Skip to content

Commit

Permalink
Migrate to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
olokobayusuf committed Mar 20, 2024
1 parent c9fcdb0 commit 7186f17
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
python3 -m pip install build twine
python3 -m pip install -r requirements.txt
- name: Pull EdgeFunction
run: python3 edgefxn.py

- name: Build
run: python3 setup.py sdist bdist_wheel
- name: Build Function
run: python3 -m build

- uses: actions/upload-artifact@v4
with:
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,27 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: "3.9"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
python3 -m pip install build twine
python3 -m pip install -r requirements.txt
- name: Pull EdgeFunction
run: python3 edgefxn.py

- name: Build and publish
- name: Build Function
run: python3 -m build

- name: Publish to PyPi
run: python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*

- uses: actions/upload-artifact@v4
with:
name: Wheels
path: dist/
18 changes: 12 additions & 6 deletions .github/workflows/testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,28 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: "3.9"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
python3 -m pip install build twine
python3 -m pip install -r requirements.txt
- name: Pull EdgeFunction
run: python3 edgefxn.py

- name: Build and publish
- name: Build Function
run: python3 -m build

- name: Publish to TestPyPi
run: python3 -m twine upload dist/*
env:
TWINE_REPOSITORY: testpypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: |
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*

- uses: actions/upload-artifact@v4
with:
name: Wheels
path: dist/
61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# Function
# Copyright © 2024 NatML Inc. All Rights Reserved.
#

[project]
name = "fxn"
dynamic = ["version"]
description = "Run on-device and cloud AI prediction functions in Python. Register at https://fxn.ai."
readme = "README.md"
dependencies = [
"aiohttp",
"magika",
"numpy",
"pillow",
"pydantic>=2.0",
"requests",
"rich",
"typer"
]
requires-python = ">=3.9"
authors = [ { name = "NatML Inc.", email = "hi@fxn.ai" } ]
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Software Development :: Libraries",
]

[project.urls]
Homepage = "https://fxn.ai"
Documentation = "https://docs.fxn.ai"
Source = "https://github.com/fxnai/fxn"
Changelog = "https://github.com/fxnai/fxn/blob/main/Changelog.md"

[project.optional-dependencies]
# None

[project.scripts]
fxn = "fxn.cli.__init__:app"

[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
include = ["fxn", "fxn*"]
namespaces = false

[tool.setuptools.package-data]
"fxn.libs.macos" = ["*.dylib"]
"fxn.libs.windows" = ["*.dll"]
"fxn.libs.linux" = ["*.so"]

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

0 comments on commit 7186f17

Please sign in to comment.