-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
564b60d
commit a922df9
Showing
3 changed files
with
63 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,12 @@ name = "function-sampler" | |
packages = [ | ||
{ include = "function_sampler" }, | ||
] | ||
version = "0.1.5" | ||
version = "0.1.6" | ||
description = "Function calling Logit Sampler" | ||
authors = ["Nathan Hoos <[email protected]>"] | ||
license = "Apache 2.0" | ||
readme = "README.md" | ||
url = "https://github.com/unaidedelf8777/function-sampler/" | ||
|
||
classifiers = [ | ||
"Programming Language :: Rust", | ||
|
@@ -27,11 +28,10 @@ jsonref = "^1.1.0" | |
torch = "^2.2.2" | ||
joblib = "^1.3.2" | ||
jsonschema = "^4.21.1" | ||
toml = "^0.10.2" | ||
interegular = "0.3.3" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
ruff = "^0.3.1" | ||
maturin = "^1.5.1" | ||
pre-commit = "^3.7.0" | ||
setuptools-rust = "^1.9.0" | ||
|
||
|
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 |
---|---|---|
@@ -1,42 +1,48 @@ | ||
from setuptools import setup, find_packages | ||
from setuptools_rust import Binding, RustExtension | ||
import toml | ||
|
||
# Load the contents of your pyproject.toml | ||
with open('pyproject.toml', 'r') as pyproject_file: | ||
pyproject_data = toml.load(pyproject_file) | ||
|
||
# Extract package metadata | ||
metadata = pyproject_data.get('tool', {}).get('poetry', {}) | ||
metadata = { | ||
'name': "function-sampler", | ||
'version': "0.1.5", | ||
'description': "Function calling Logit Sampler", | ||
'long_description': "", | ||
'authors': ["unaidedelf8777"], | ||
'author_email': "[email protected]", | ||
'license': "Apache 2.0", | ||
'classifiers': [ | ||
"Programming Language :: Rust", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
], | ||
'url': "https://github.com/unaidedelf8777/function-sampler/", | ||
} | ||
|
||
# Define the Rust extension module, assuming it's the same name as the package name | ||
rust_extensions = [ | ||
RustExtension( | ||
f"function_sampler.fsm.fsm_utils", # Python package.module for the Rust extension | ||
f"./Cargo.toml", # Path to Cargo.toml of Rust extension | ||
f"function_sampler.fsm.fsm_utils", | ||
f"./Cargo.toml", | ||
binding=Binding.PyO3, | ||
features=["default"], | ||
args=["--profile=release"] | ||
), | ||
] | ||
|
||
setup( | ||
name=metadata.get('name'), | ||
version=metadata.get('version'), | ||
author=",".join(metadata.get('authors', [])), | ||
author_email=metadata.get('emails', [''])[0], | ||
description=metadata.get('description', ''), | ||
long_description=metadata.get('description', ''), | ||
name=metadata['name'], | ||
version=metadata['version'], | ||
author=metadata['authors'][0].split(" <")[0], # Extracting name | ||
author_email=metadata['author_email'], | ||
description=metadata['description'], | ||
long_description=open("README.md").read(), | ||
long_description_content_type="text/markdown", | ||
url=metadata.get('homepage', ''), | ||
classifiers=metadata.get('classifiers', []), | ||
keywords=",".join(metadata.get('keywords', [])), | ||
license=metadata.get('license', ''), | ||
url=metadata['url'], | ||
classifiers=metadata['classifiers'], | ||
license=metadata['license'], | ||
packages=find_packages(), | ||
include_package_data=True, | ||
zip_safe=False, | ||
python_requires='>=3.9', | ||
setup_requires=['setuptools-rust', 'wheel', 'toml'], | ||
setup_requires=['setuptools_rust', 'wheel'], | ||
rust_extensions=rust_extensions, | ||
) | ||
|