Skip to content

Commit

Permalink
conf: fix setup.py & requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
wlemuel committed Nov 10, 2022
1 parent 8fde655 commit 8c0bf06
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
djangorestframework>=3.10.3
django>=2.2.16
django>=2.2.16
pycryptodome>=3.9.1
28 changes: 18 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,39 @@

import io
import os
import re

from setuptools import setup

from rest_framework_vault import __version__ as VERSION

_pkg = "rest_framework_vault"

def read_req(req_file):
with open(os.path.join("requirements", req_file)) as req:
return [
line.strip()
for line in req.readlines()
if line.strip() and not line.strip().startswith("#")
]

def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, "__init__.py")).read()
return re.search("^__version__ = ['\"]([^'\"]+)['\"]", init_py, re.MULTILINE).group(
1
)


with io.open("README.md", encoding="utf-8") as readme:
description = readme.read()

requirements = read_req("base.txt")
requirements = [
"Django>=2.2.16",
"djangorestframework>=3.10.3",
"pycryptodome>=3.9.1",
]
VERSION = get_version(_pkg)

setup(
name="django-rest-vault",
version=VERSION,
install_requires=requirements,
packages=["rest_framework_vault"],
packages=[_pkg],
include_package_data=True,
license="MIT License",
description="Api data decryption and encryption support for Django REST Framework",
Expand Down

0 comments on commit 8c0bf06

Please sign in to comment.