-
Notifications
You must be signed in to change notification settings - Fork 120
/
setup.py
executable file
·42 lines (30 loc) · 1.03 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
# SPDX-FileCopyrightText: Christian Amsüss and the aiocoap contributors
#
# SPDX-License-Identifier: MIT
from setuptools import setup, Command
class Cite(Command):
description = """Print how to cite aiocoap in a publication"""
user_options = [("bibtex", None, "Output citation data as bibtex")]
boolean_options = ["bibtex"]
def initialize_options(self):
self.bibtex = False
def finalize_options(self):
pass
def run(self):
if self.bibtex:
print(self.bibtex_text)
else:
print(self.plain_text)
plain_text = """Amsüss, Christian and the aiocoap contributors. aiocoap: Python CoAP Library. 2013–. https://christian.amsuess.com/tools/aiocoap/"""
bibtex_text = """@Misc{,
author = {Christian Amsüss and aiocoap contributors},
title = {{aiocoap}: Python CoAP Library},
year = {2013--},
url = {https://christian.amsuess.com/tools/aiocoap/},
}"""
setup(
cmdclass={
"cite": Cite,
},
)