Skip to content

Commit 3e38bf1

Browse files
committed
build: moves most sections from setup.py to the pyproject.toml.
1 parent 703cb9c commit 3e38bf1

File tree

3 files changed

+45
-35
lines changed

3 files changed

+45
-35
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
UTIL_VERSION := $(shell grep -Po 'version\s*=\s*"\K[\d.]+' pyproject.toml)
2-
UTIL_NAME := $(shell grep -Po 'name\s*=\s*"\K\w+' pyproject.toml)
1+
UTIL_VERSION := $(shell grep -Po '^version\s*=\s*"\K[\d.]+' pyproject.toml)
2+
UTIL_NAME := $(shell grep -Po '^name\s*=\s*"\K\w+' pyproject.toml)
33
PWD := $(shell pwd)
44

55
USER_UID ?= $(shell id --user)

pyproject.toml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,49 @@
22
name = "codeplag"
33
version = "0.6.0"
44
description = "Code plagiarism searching package."
5-
readme = "README.md"
5+
authors = [
6+
{ name = "Artyom Semidolin, Dmitry Nikolaev, Alexander Evsikov" }
7+
]
8+
readme = {file = "README.md", content-type = "text/markdown"}
9+
license = "MIT"
10+
license-files = ["LICENSE"]
611
requires-python = "~=3.12"
12+
classifiers = [
13+
"Development Status :: 4 - Beta",
14+
"Environment :: Console",
15+
"Intended Audience :: Education",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.12",
18+
"Topic :: Software Development :: Plagiarism Detection",
19+
]
20+
dependencies = [
21+
"argcomplete~=3.5.3",
22+
"numpy~=1.26.4",
23+
"pandas~=2.2.3",
24+
"ccsyspath~=1.1.0",
25+
"clang~=18.1.8",
26+
"llvmlite~=0.45.1",
27+
"libclang~=18.1.1",
28+
"python-decouple~=3.8",
29+
"requests~=2.32.3",
30+
"typing-extensions~=4.12.2",
31+
"aiohttp~=3.9.3",
32+
"Jinja2~=3.1.5",
33+
"cachetools==5.5.2",
34+
"gidgethub~=5.3.0",
35+
"pymongo~=4.12.1",
36+
]
37+
38+
[project.urls]
39+
Repository = "https://github.com/OSLL/code-plagiarism"
40+
Issues = "https://github.com/OSLL/code-plagiarism/issues"
41+
42+
[project.scripts]
43+
codeplag = "codeplag:main"
44+
45+
[build-system]
46+
requires = ["setuptools~=80.9.0", "Cython~=3.1.6"]
47+
build-backend = "setuptools.build_meta"
748

849
[tool.ruff]
950
builtins = ["_"]
@@ -61,9 +102,6 @@ executionEnvironments = [
61102

62103
typeCheckingMode = "standard"
63104

64-
[build-system]
65-
requires = ["setuptools", "Cython"]
66-
67105
[tool.coverage.run]
68106
branch = true
69107

setup.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import sys
32
from pathlib import Path
43

@@ -36,8 +35,6 @@
3635
"gidgethub~=5.3.0",
3736
"pymongo~=4.12.1",
3837
)
39-
UTIL_NAME = os.getenv("UTIL_NAME")
40-
UTIL_VERSION = os.getenv("UTIL_VERSION")
4138

4239

4340
if "--build-requirements" in sys.argv:
@@ -52,9 +49,6 @@
5249
if "--install-requirements" in sys.argv:
5350
print(" ".join(INSTALL_REQUIREMENTS))
5451
sys.exit(0)
55-
if UTIL_NAME is None or UTIL_VERSION is None:
56-
print("Please provide UTIL_NAME and UTIL_VERSION environment variables.")
57-
sys.exit(1)
5852
try:
5953
from Cython.Build import cythonize
6054
from setuptools import Extension, find_packages, setup
@@ -67,37 +61,15 @@
6761

6862

6963
setup(
70-
name=f"{UTIL_NAME}",
71-
version=f"{UTIL_VERSION}",
72-
description="Code plagiarism searching package.",
73-
author="Artyom Semidolin, Dmitry Nikolaev, Alexander Evsikov",
74-
url="https://github.com/OSLL/code-plagiarism",
7564
long_description=Path("README.md").read_text(encoding="utf-8"),
7665
long_description_content_type="text/markdown",
77-
license="MIT License",
7866
platforms=["linux"],
79-
classifiers=[
80-
"Development Status :: 4 - Beta",
81-
"Environment :: Console",
82-
"Intended Audience :: Education",
83-
"License :: OSI Approved :: MIT License",
84-
"Programming Language :: Python :: 3",
85-
"Programming Language :: Python :: 3.12",
86-
"Topic :: Software Development :: Plagiarism Detection",
87-
],
8867
package_dir={"": "src"},
8968
packages=find_packages("src"),
9069
ext_modules=cythonize(
9170
[
92-
Extension("*", [f"src/{UTIL_NAME}/**/*.py"]),
71+
Extension("*", [f"src/codeplag/**/*.py"]),
9372
],
9473
language_level=3,
9574
),
96-
python_requires=">=3.12",
97-
install_requires=INSTALL_REQUIREMENTS,
98-
entry_points={
99-
"console_scripts": [
100-
f"{UTIL_NAME} = {UTIL_NAME}:main",
101-
]
102-
},
10375
)

0 commit comments

Comments
 (0)