-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from harishmohanraj/fix-upstream-conflicts-2
Fix upstream conflicts 2
- Loading branch information
Showing
15 changed files
with
355 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env python | ||
|
||
|
||
# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from pathlib import Path | ||
|
||
import toml | ||
from jinja2 import Template | ||
|
||
|
||
def get_optional_dependencies(pyproject_path: str) -> dict: | ||
with open(pyproject_path, "r") as f: | ||
pyproject_data = toml.load(f) | ||
|
||
optional_dependencies = pyproject_data.get("project", {}).get("optional-dependencies", {}) | ||
return optional_dependencies | ||
|
||
|
||
# Example usage | ||
pyproject_path = Path(__file__).parent.joinpath("../pyproject.toml") | ||
optional_dependencies = get_optional_dependencies(pyproject_path) | ||
optional_groups = [group for group in optional_dependencies.keys()] | ||
|
||
# for group, dependencies in optional_dependencies.items(): | ||
# print(f"Group: {group}") | ||
# for dependency in dependencies: | ||
# print(f" - {dependency}") | ||
|
||
template_path = Path(__file__).parents[1].joinpath("setup.jinja") | ||
assert template_path.exists() | ||
|
||
with template_path.open("r") as f: | ||
template_str = f.read() | ||
|
||
if len(template_str) < 100: | ||
raise ValueError("Template string is too short") | ||
|
||
# Create a Jinja2 template object | ||
template = Template(template_str) | ||
|
||
for name in ["ag2", "autogen"]: | ||
file_name = f"setup_{name}.py" | ||
file_path = Path(__file__).parents[1].joinpath(file_name) | ||
# Render the template with the optional dependencies | ||
rendered_setup_py = template.render(optional_dependencies=optional_dependencies, name=name) | ||
|
||
# Write the rendered setup.py to a file | ||
with file_path.open("w") as setup_file: | ||
setup_file.write(rendered_setup_py) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# taken from: https://jaredkhan.com/blog/mypy-pre-commit | ||
|
||
# A script for running mypy, | ||
# with all its dependencies installed. | ||
|
||
set -o errexit | ||
|
||
# Change directory to the project root directory. | ||
cd "$(dirname "$0")"/.. | ||
|
||
./scripts/build-setup-files.py | ||
ruff check -s setup_*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# this file is autogenerated, please do not edit it directly | ||
# instead, edit the corresponding setup.jinja file and run the ./scripts/build-setup-files.py script | ||
|
||
import os | ||
|
||
import setuptools | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
with open("README.md", "r", encoding="UTF-8") as fh: | ||
long_description = fh.read() | ||
|
||
# Get the code version | ||
version = {} | ||
with open(os.path.join(here, "autogen/version.py")) as fp: | ||
exec(fp.read(), version) | ||
__version__ = version["__version__"] | ||
|
||
setuptools.setup( | ||
name="{{ name }}", | ||
version=__version__, | ||
description="Alias package for pyautogen", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
install_requires=["pyautogen==" + __version__], | ||
extras_require={ | ||
{% for group, packages in optional_dependencies.items() -%} | ||
"{{ group }}": ["pyautogen[{{ group }}]==" + __version__], | ||
{% endfor %} | ||
}, | ||
url="https://github.com/ag2ai/ag2", | ||
author="Chi Wang & Qingyun Wu", | ||
author_email="[email protected]", | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
], | ||
license="Apache Software License 2.0", | ||
python_requires=">=3.9,<3.14", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.