Skip to content

Commit

Permalink
Remove logging and update package path
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Mar 19, 2021
1 parent 85b6f4c commit 0801ed9
Showing 1 changed file with 15 additions and 45 deletions.
60 changes: 15 additions & 45 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,13 @@
import setuptools, logging
from pathlib import Path

# Configure the logger
logger_name = "webqueueapi_install_log"
logger = logging.getLogger(logger_name)
logger.setLevel(logging.DEBUG)

# See Formatting Details: https://docs.python.org/3/library/logging.html#logrecord-attributes
# Example: Jan 28 2021 12:19:28 venv-manager : [INFO] Message
log_message_format = "%(asctime)s %(name)s : [%(levelname)s] %(message)s"
# See Time Formatting Details: https://docs.python.org/3.6/library/time.html#time.strftime
# Example: Jan 28 2021 12:19:28
log_time_format = "%b %d %Y %H:%M:%S"
log_formatter = logging.Formatter(log_message_format, log_time_format)

# Configure output to stdout
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(log_formatter)
stream_handler.setLevel(logging.INFO)
logger.addHandler(stream_handler)

# Configure out to logfile, located in '/tmp/webqueueapi install log.log'
log_file_path = Path(f"/tmp/{logger_name}.log")
file_handler = logging.FileHandler(log_file_path)
file_handler.setFormatter(log_formatter)
logger.addHandler(file_handler)

logger.debug("Attempting to install webqueue2-api package")
from setuptools import setup, find_packages

setuptools.setup(
name="webqueue2-api",
name="webqueue2_api",
version="0.9.1",
description="A library for managing Purdue ECN's queue system.",
py_modules=['api', 'ECNQueue'],
python_requires='>=3.6',
packages=find_packages(),
install_requires = [
# General Utilities
"pipdeptree",
"gunicorn",
"pylint",

# API
"python-dotenv",
"Flask-RESTful",
"python-dateutil",
Expand All @@ -49,12 +16,15 @@
"PyJWT == 1.*",
# Custom version of python-ldap without SASL requirements
"python-ldap @ git+https://github.itap.purdue.edu/ECN/python-ldap/@python-ldap-3.3.1",

# API Documentation
"mkdocs",
"mkdocs-material",
"mkautodoc"
]
)

logger.info("webqueue2-api package installed sucessfully")
],
extras_require={
"dev": [
"pylint"
],
"docs": [
"mkdocs",
"mkdocs-material",
"mkautodoc"
]
}
)

0 comments on commit 0801ed9

Please sign in to comment.