-
Notifications
You must be signed in to change notification settings - Fork 181
Move pyproject.toml support to setuptools modern build backend #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
loadams
wants to merge
19
commits into
main
Choose a base branch
from
loadams/add-pyproject-toml
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
52aa85f
Add pyproject.toml
loadams 9fe529c
Fix EOF
loadams 96fae4e
Merge branch 'main' into loadams/add-pyproject-toml
loadams 2aebe92
Merge branch 'main' into loadams/add-pyproject-toml
loadams e2a93b8
Merge branch 'main' into loadams/add-pyproject-toml
loadams e83f6fa
Update references to requirements
loadams 62a8dc5
Add requirements folder to path
loadams 978e1b6
Move to setuptools modern build system
loadams 67151c1
Resolve merge conflicts
loadams f7b5394
Merge branch 'main' into loadams/add-pyproject-toml
loadams 396f0ec
Update and move requirements files
loadams cf92465
Update to move requirements to pyproject.toml
loadams 458e981
Update dependencies
loadams 798acc9
More updates
loadams cc40e45
Move more things
loadams 743602f
Update fields not permitted
loadams fe4346b
Update
loadams a1045fe
long dictionary
loadams 73acfe9
content type too
loadams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,66 @@ requires = [ | |
"setuptools>=64", | ||
"wheel" | ||
] | ||
# Use legacy backend to import local packages in setup.py | ||
build-backend = "setuptools.build_meta:__legacy__" | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "deepspeed-mii" | ||
dynamic = ["version"] | ||
description = "deepspeed mii" | ||
authors = [{name = "DeepSpeed Team", email = "[email protected]"}] | ||
dependencies = [ | ||
"accelerate", | ||
"asyncio", | ||
"deepspeed>=0.15.0", | ||
"deepspeed-kernels", | ||
"fastapi", | ||
"fastchat", | ||
"Flask-RESTful", | ||
"grpcio", | ||
"grpcio-tools", | ||
"Pillow", | ||
"pydantic>=2.0.0", | ||
"pyzmq", | ||
"safetensors", | ||
"shortuuid", | ||
"torch", | ||
"transformers", | ||
"ujson", | ||
"Werkzeug" | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"clang-format==18.1.3", | ||
"einops", | ||
"pre-commit>=2.20.0", | ||
"pytest", | ||
"pytest-forked", | ||
"sentencepiece", | ||
"tiktoken", | ||
"transformers-stream-generator" | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://github.com/deepspeedai/DeepSpeed-MII" | ||
Source = "https://github.com/deepspeedai/DeepSpeed-MII" | ||
|
||
[tool.setuptools.dynamic] | ||
version = {file = ["version.txt"]} | ||
|
||
[tool.setuptools] | ||
classifiers = [ | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
|
||
[tool.setuptools.package-data] | ||
long_description = ["README.md"] | ||
long_description_content_type = ["text/markdown"] | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["."] | ||
exclude = ["tests"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,16 +8,6 @@ | |
from setuptools import setup, find_packages | ||
|
||
|
||
def fetch_requirements(path): | ||
with open(path, 'r') as fd: | ||
return [r.strip() for r in fd.readlines()] | ||
|
||
|
||
install_requires = fetch_requirements('requirements/requirements.txt') | ||
|
||
extras_require = {"dev": fetch_requirements('requirements/requirements-dev.txt')} | ||
|
||
|
||
def command_exists(cmd): | ||
if sys.platform == "win32": | ||
result = subprocess.Popen(f'{cmd}', stdout=subprocess.PIPE, shell=True) | ||
|
@@ -71,31 +61,7 @@ def command_exists(cmd): | |
with open("mii/version.py", 'w') as fd: | ||
fd.write(f"__version__ = '{version_str}'\n") | ||
|
||
# Parse README.md to make long_description for PyPI page. | ||
thisdir = os.path.abspath(os.path.dirname(__file__)) | ||
with open(os.path.join(thisdir, 'README.md'), encoding='utf-8') as fin: | ||
readme_text = fin.read() | ||
print("PACKAGES", find_packages()) | ||
setup(name="deepspeed-mii", | ||
version=version_str, | ||
long_description=readme_text, | ||
long_description_content_type='text/markdown', | ||
description='deepspeed mii', | ||
author='DeepSpeed Team', | ||
author_email='[email protected]', | ||
url='http://deepspeed.ai', | ||
project_urls={ | ||
'Documentation': 'https://github.com/deepspeedai/DeepSpeed-MII', | ||
'Source': 'https://github.com/deepspeedai/DeepSpeed-MII', | ||
}, | ||
install_requires=install_requires, | ||
extras_require=extras_require, | ||
packages=find_packages(exclude=("tests", | ||
)), | ||
classifiers=[ | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12' | ||
]) | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to handle the readthedocs case too.