Skip to content
Snippets Groups Projects
Commit 6d8c9154 authored by Manon Blanco's avatar Manon Blanco
Browse files

Use pyproject.toml to store package metadata

parent 525c1a9e
No related branches found
No related tags found
No related merge requests found
Pipeline #150404 passed
include requirements.txt
include VERSION
0.3.0
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "nerval"
version = "0.3.0"
description = "Tool to evaluate NER on noisy text."
dynamic = ["dependencies"]
authors = [
{ name = "Teklia", email = "contact@teklia.com" },
]
maintainers = [
{ name = "Teklia", email = "contact@teklia.com" },
]
readme = { file = "README.md", content-type = "text/markdown" }
[project.scripts]
nerval = "nerval.cli:main"
[tool.setuptools]
packages = ["nerval"]
[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
[tool.ruff]
exclude = [".git", "__pycache__"]
ignore = [
......
#!/usr/bin/env python
from pathlib import Path
from setuptools import find_packages, setup
def parse_requirements_line(line):
"""Special case for git requirements"""
if line.startswith("git+http"):
assert "@" in line, "Branch should be specified with suffix (ex: @master)"
assert (
"#egg=" in line
), "Package name should be specified with suffix (ex: #egg=kraken)"
package_name = line.split("#egg=")[-1]
return f"{package_name} @ {line}"
else:
return line
def parse_requirements():
path = Path(__file__).parent.resolve() / "requirements.txt"
assert path.exists(), f"Missing requirements: {path}"
return list(
map(parse_requirements_line, map(str.strip, path.read_text().splitlines())),
)
setup(
name="nerval",
version=Path("VERSION").read_text(),
description="Tool to evaluate NER on noisy text.",
author="Teklia",
author_email="contact@teklia.com",
packages=find_packages(),
entry_points={"console_scripts": ["nerval=nerval.cli:main"]},
install_requires=parse_requirements(),
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment