-
Notifications
You must be signed in to change notification settings - Fork 433
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 #909 from google/pure-python-wheel
Build pure python wheel
- Loading branch information
Showing
8 changed files
with
110 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
name = "magika" | ||
description = "A tool to determine the content type of a file with deep learning" | ||
authors = [ | ||
{author = "Magika Developers", email = "[email protected]"}, | ||
{name = "Magika Developers", email = "[email protected]"}, | ||
] | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
license = {"text" = "Apache-2.0"} | ||
requires-python = ">=3.8" | ||
keywords = ["content type detection", "machine learning"] | ||
classifiers = [ | ||
|
@@ -57,6 +57,8 @@ dev-dependencies = [ | |
"pytest>=8.3.2", | ||
"ruff>=0.6.3", | ||
"twine>=5.1.1", | ||
"tomli-w>=1.0.0", | ||
"tomli>=2.0.1", | ||
] | ||
|
||
[build-system] | ||
|
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 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
from pathlib import Path | ||
|
||
import tomli | ||
import tomli_w | ||
|
||
|
||
def main() -> None: | ||
pyproject_toml_path = Path(__file__).parent.parent / "pyproject.toml" | ||
|
||
pyproject_content = tomli.loads(pyproject_toml_path.read_text()) | ||
|
||
# Remove entry about maturin, we don't need it | ||
_ = pyproject_content["tool"].pop("maturin") | ||
|
||
# Tell uv we want to use the hatchling build system | ||
pyproject_content["build-system"] = { | ||
"requires": ["hatchling"], | ||
"build-backend": "hatchling.build", | ||
} | ||
|
||
# Make the python's magika client available as a script | ||
pyproject_content["project"]["scripts"] = { | ||
"magika": "magika.cli.magika_client:main", | ||
} | ||
|
||
pyproject_toml_path.write_text(tomli_w.dumps(pyproject_content)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.