Skip to content

Commit

Permalink
Update package distribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 committed Dec 8, 2023
1 parent 847dc5b commit da2ce2f
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 144 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: deploy

on: push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-n-publish:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Build agentlego
run: |
pip install build
python -m build --sdist --wheel
- name: Publish distribution to PyPI
run: |
pip install twine
twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }}
2 changes: 1 addition & 1 deletion agentlego/utils/dependency.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import re
import warnings
from functools import wraps
from importlib.metadata import PackageNotFoundError, distribution
from inspect import isfunction

from importlib_metadata import PackageNotFoundError, distribution
from packaging.version import parse


Expand Down
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["setuptools >= 62.6"]
build-backend = "setuptools.build_meta"

[project]
name = "agentlego"
authors = [
{name = "AgentLego Contributors"}
]
maintainers = [
{name = "mzr1996", email = "[email protected]"}
]
description = "AgentLego is a versatile tool library for enhancing LLM-based agents."
requires-python = ">=3.8"
keywords = ["LLM", "Multi-Modality", "AI Agent"]
license = {text = "Apache License 2.0"}
classifiers = [
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Programming Language :: Python :: 3",
]
dynamic = ["version", "readme", "dependencies", "optional-dependencies"]

[project.urls]
Documentation = "https://agentlego.readthedocs.io"
Repository = "https://github.com/InternLM/agentlego"

[tool.setuptools.packages.find]
include = ["agentlego"]
namespaces = false

[tool.setuptools.dynamic]
version = {attr = "agentlego.version.__version__"}
readme = {file = "README.md"}
dependencies = {file = "requirements/runtime.txt"}

[tool.setuptools.dynamic.optional-dependencies]
all = {file = "requirements/optional.txt"}

[tool.yapf]
based_on_style = "pep8"
blank_line_before_nested_class_or_def = true
split_before_expression_after_opening_paren = true
split_penalty_import_names = 0
SPLIT_PENALTY_AFTER_OPENING_BRACKET = 800

[tool.isort]
line_length = 79
multi_line_output = 0
known_first_party = "agentlego"
no_lines_before = ["STDLIB", "LOCALFOLDER"]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
3 changes: 1 addition & 2 deletions requirements/runtime.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
func_timeout
importlib_metadata
mmengine
mmengine>=0.8
numpy
opencv-python
packaging
Expand Down
21 changes: 0 additions & 21 deletions setup.cfg

This file was deleted.

120 changes: 0 additions & 120 deletions setup.py

This file was deleted.

0 comments on commit da2ce2f

Please sign in to comment.