You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classifiers= ["Development Status :: 2 - Pre-Alpha", "Intended Audience :: Other Audience", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.9", "Topic :: Scientific/Engineering :: Mathematics"],
17
-
package_dir= {'': 'mathplug'},
18
-
extras_require= {
19
-
"dev": [
20
-
"pytest >= 7.1",
21
-
],
22
-
},
23
-
)
26
+
27
+
# Python 3 assertion
28
+
assertsys.version_info.major>=3, f"{color.LIGHTRED}Python version must be 3 or higher."
29
+
30
+
# Arguments
31
+
args=sys.argv
32
+
num_args=len(args)
33
+
program_name=args[0]
34
+
version="0.0.1"
35
+
run_pytest_after_setup=False
36
+
37
+
defrun_program():
38
+
if (num_args>1): # if arguments are passed
39
+
arg=args[1]
40
+
matcharg:
41
+
case'-v'|'--version': # display version number
42
+
print(f"Running {color.DARKGRAY}mathplug{color.DEFAULT} version {color.GREEN}v{version}{color.DEFAULT}.")
43
+
case'bdist_wheel': # create package files
44
+
withopen("README.md", "r") asfh:
45
+
long_description=fh.read()
46
+
47
+
setup(
48
+
name='mathplug',
49
+
version='0.0.2',
50
+
description='A lightweight Python package which supplies simple math functions.',
classifiers= ["Development Status :: 2 - Pre-Alpha", "Intended Audience :: Other Audience", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.9", "Topic :: Scientific/Engineering :: Mathematics"],
58
+
package_dir= {'': 'mathplug'},
59
+
extras_require= {
60
+
"dev": [
61
+
"pytest >= 7.1",
62
+
],
63
+
},
64
+
)
65
+
ifrun_pytest_after_setup:
66
+
os.system("pytest")
67
+
caseother: # incorrect
68
+
print(f"{color.RED}ERROR: {color.LIGHTRED}argument not recognized:{color.DEFAULT}{other}")
69
+
else:
70
+
print(f"If no arguments are required, use {color.GREEN}<python | python3> <setup.py> <bdist_wheel> {color.DEFAULT} to run setup.")
0 commit comments