diff --git a/.github/workflows/edge.yml b/.github/workflows/edge.yml index b7fb521..e0a5d02 100644 --- a/.github/workflows/edge.yml +++ b/.github/workflows/edge.yml @@ -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: diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 82930fd..2c98bd3 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -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/* \ No newline at end of file + + - uses: actions/upload-artifact@v4 + with: + name: Wheels + path: dist/ \ No newline at end of file diff --git a/.github/workflows/testpypi.yml b/.github/workflows/testpypi.yml index 3308ff2..cbd9c24 100644 --- a/.github/workflows/testpypi.yml +++ b/.github/workflows/testpypi.yml @@ -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/* \ No newline at end of file + + - uses: actions/upload-artifact@v4 + with: + name: Wheels + path: dist/ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d9f2ad1 --- /dev/null +++ b/pyproject.toml @@ -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__" } \ No newline at end of file