
* Fix small error in venv setup guide * Add functions for mm integration Implemented: create channels for groups Implemented: create webhooks on both sides for groups As for now these functions can only be called from the Python REPL * Add commands for mm channel/webhook creation Implemented: archive a given list of channels (unused) * Add new features to README * Add filter argument for channel/webhook creation This filter argument is optional and defaults to an empty string, meaning no filtering is required. This is helpful for excluding previous project repos or irrelevant repos. Also added detection logic to handle an exception where a student is on MM but not in the target team. (Perhaps we would want to invite that student immediately?) * Update README Clarify platform difference for venv Restructure Commands & Features section to make room for better docs * Remove unused function from Canvas worker * Add gitea domain name and suffix config items Align with the mm worker, and grant more flexibility Also changed terminology to be clearer (`domain_name` instead of `url`) * Code style and quality updates * Add domain name and suffix config items for Canvas * Return to using dicts to represent groups Removed `StudentGroup` at BoYanZh's request
51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
import os
|
|
import re
|
|
from typing import List
|
|
|
|
from setuptools import find_packages, setup
|
|
|
|
|
|
def get_version(package: str) -> str:
|
|
"""
|
|
Return package version as listed in `__version__` in `__init__.py`.
|
|
"""
|
|
path = os.path.join(package, "__init__.py")
|
|
main_py = open(path, "r", encoding="utf8").read()
|
|
match = re.search("__version__ = ['\"]([^'\"]+)['\"]", main_py)
|
|
if match is None:
|
|
return "0.0.0"
|
|
return match.group(1)
|
|
|
|
|
|
def get_long_description() -> str:
|
|
"""
|
|
Return the README.
|
|
"""
|
|
return open("README.md", "r", encoding="utf8").read()
|
|
|
|
|
|
def get_install_requires() -> List[str]:
|
|
"""
|
|
Return each line of requirements.txt.
|
|
"""
|
|
return open("requirements.txt").read().splitlines()
|
|
|
|
|
|
setup(
|
|
name="joint-teapot",
|
|
version=get_version("joint_teapot"),
|
|
url="https://github.com/BoYanZh/joint-teapot",
|
|
license="MIT",
|
|
description="A handy tool for TAs in JI to handle stuffs through Gitea, Canvas, JOJ and Mattermost.",
|
|
long_description=get_long_description(),
|
|
long_description_content_type="text/markdown",
|
|
author="BoYanZh",
|
|
author_email="bomingzh@sjtu.edu.cn",
|
|
maintainer="BoYanZh",
|
|
maintainer_email="bomingzh@sjtu.edu.cn",
|
|
packages=find_packages(),
|
|
python_requires=">=3.6",
|
|
entry_points={"console_scripts": ["joint-teapot=joint_teapot:main"]},
|
|
install_requires=get_install_requires(),
|
|
)
|