Skip to content

Commit 11f08e9

Browse files
authored
setup.py
1 parent eb893e9 commit 11f08e9

File tree

6 files changed

+44
-0
lines changed

6 files changed

+44
-0
lines changed

detector/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

detector/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__version__ = "0.1.0"
2+
from .detector import OpenaiDetector
File renamed without changes.
File renamed without changes.

setup.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""Python setup.py for package"""
2+
import io
3+
import os
4+
5+
from setuptools import find_packages, setup
6+
7+
8+
def read(*paths, **kwargs):
9+
"""Read the contents of a text file safely.
10+
>>> read("project_name", "VERSION")
11+
'0.1.0'
12+
>>> read("README.md")
13+
...
14+
"""
15+
16+
content = ""
17+
with io.open(
18+
os.path.join(os.path.dirname(__file__), *paths),
19+
encoding=kwargs.get("encoding", "utf8"),
20+
) as open_file:
21+
content = open_file.read().strip()
22+
return content
23+
24+
25+
def read_requirements(path):
26+
return [line.strip() for line in read(path).split("\n") if not line.startswith(('"', "#", "-", "git+"))]
27+
28+
29+
setup(
30+
name="openai-detector",
31+
version=read("detector", "VERSION"),
32+
description="Open AI classifier for indicating AI-written text",
33+
url="https://github.com/promptslab/openai-detector",
34+
long_description=read("README.md"),
35+
long_description_content_type="text/markdown",
36+
license="Apache",
37+
author="monk1337",
38+
maintainer="All our contributors",
39+
packages=find_packages(),
40+
install_requires=read_requirements("requirements.txt"),
41+
python_requires=">=3.7.0",)

src/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)