Skip to content

Commit

Permalink
Merge branch 'work/pyproject' into 'master'
Browse files Browse the repository at this point in the history
add pyproject.toml, use python3 -m build to create whl

See merge request deep-learning/tensornet!16
  • Loading branch information
jiangxinglei committed Sep 14, 2024
2 parents e56ed85 + 5714449 commit 9742fb8
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ values =
[bumpversion:part:build]

[bumpversion:file:tensornet/version.py]

[bumpversion:file:pyproject.toml]
3 changes: 2 additions & 1 deletion config/tn_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ dependencies:
- patch
- pip
- pip:
- tensorflow==2.2.0
- tensorflow-cpu >=2.2,<2.3
- protobuf<3.21
- grpcio<1.47 # Only for CentOS 6
- h5py<3.8 # Only for CentOS 6
- twine
- wheel
- build
6 changes: 5 additions & 1 deletion manager
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ start_create_dist(){
[[ ${NEED_ACTIVATE_ENV} == true ]] && _activate_env
rm -rf dist/* || true
PY_VERSION=$(python -c "import sys; print('cp' + ''.join(map(str, sys.version_info[:2])))")
python setup.py bdist_wheel --plat-name manylinux2010_x86_64 --python-tag "${PY_VERSION}"
cat >setup.cfg <<-END
[bdist_wheel]
python_tag = $PY_VERSION
END
python3 -m build -w -n
twine check dist/*
}

Expand Down
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[project]
name = "qihoo-tensornet"
version = "0.1.3.post2"
description = "build tensornet"
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.7,<3.8"
authors = [
{name="jiangxinglei",email="[email protected]"},
{name="gaozhiming",email="[email protected]"}
]
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.7'
]
dependencies = [
"tensorflow-cpu >=2.2,<2.3"
]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.distutils.bdist_wheel]
plat_name = "manylinux2010_x86_64"
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
package_data = {
"tensornet.core": ["_pywrap_tn.so"],
},
install_requires=[
'tensorflow>=2.2,<2.3'
],
python_requires='>=3.7, <3.8',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.7'
],
platforms = ["manylinux2010_x86_64"],
)

0 comments on commit 9742fb8

Please sign in to comment.