Skip to content

Commit 9b8246b

Browse files
committed
init
0 parents  commit 9b8246b

File tree

135 files changed

+93085
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+93085
-0
lines changed

.gitignore

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.nox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*.cover
48+
.hypothesis/
49+
.pytest_cache/
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
local_settings.py
58+
db.sqlite3
59+
60+
# Flask stuff:
61+
instance/
62+
.webassets-cache
63+
64+
# Scrapy stuff:
65+
.scrapy
66+
67+
# Sphinx documentation
68+
docs/_build/
69+
70+
# PyBuilder
71+
target/
72+
73+
# Jupyter Notebook
74+
.ipynb_checkpoints
75+
76+
# IPython
77+
profile_default/
78+
ipython_config.py
79+
80+
# pyenv
81+
.python-version
82+
83+
# celery beat schedule file
84+
celerybeat-schedule
85+
86+
# SageMath parsed files
87+
*.sage.py
88+
89+
# Environments
90+
.env
91+
.venv
92+
env/
93+
venv/
94+
ENV/
95+
env.bak/
96+
venv.bak/
97+
98+
# Spyder project settings
99+
.spyderproject
100+
.spyproject
101+
102+
# Rope project settings
103+
.ropeproject
104+
105+
# mkdocs documentation
106+
/site
107+
108+
# mypy
109+
.mypy_cache/
110+
.dmypy.json
111+
dmypy.json
112+
113+
# Pyre type checker
114+
.pyre/
115+
116+
*.sublime-workspace
117+
118+
_gsdata_/
119+
.pytest_cache/
120+
121+
.DS_Store
122+
123+

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# 220-Advanced-Template
2+
## Not for class use - Fork me!
3+
4+
This is the master repo from which an instructor will use a fork to create their class assignment repo.
5+
6+
PLEASE do not use this for your students' assignments.

py220_grading.sublime-project

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"build_systems":
3+
[
4+
{
5+
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
6+
"name": "Anaconda Python Builder",
7+
"selector": "source.python",
8+
"shell_cmd": "\"/Users/andy/projects/uw/py220_grading/venv/bin/python3\" -u \"$file\""
9+
}
10+
],
11+
"folders":
12+
[
13+
{
14+
"follow_symlinks": true,
15+
"path": "."
16+
}
17+
],
18+
"settings":
19+
{
20+
"python_interpreter": "/Users/andy/projects/uw/py220_grading/venv/bin/python3"
21+
}
22+
}

requirements.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ansimarkup==1.4.0
2+
astroid==2.0.4
3+
atomicwrites==1.2.1
4+
attrs==18.2.0
5+
better-exceptions-fork==0.2.1.post6
6+
certifi==2018.10.15
7+
colorama==0.4.1
8+
coverage==4.5.2
9+
isort==4.3.4
10+
lazy-object-proxy==1.3.1
11+
loguru==0.2.5
12+
mccabe==0.6.1
13+
mock==2.0.0
14+
more-itertools==4.3.0
15+
pbr==5.1.1
16+
peewee==3.9.2
17+
pluggy==0.8.0
18+
py==1.7.0
19+
Pygments==2.3.1
20+
pylint==2.1.1
21+
pymongo==3.7.2
22+
pytest==4.0.0
23+
pytest-cov==2.6.1
24+
pytest-mock==1.10.0
25+
pytest-pylint==0.12.3
26+
six==1.11.0
27+
wrapt==1.10.11

students/README.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
####################
2+
Setting up your repo
3+
####################
4+
5+
1. Create a directory for yourself here
6+
2. Copy the contents of the template_student directory into your new directory
7+
3. Be sure to copy not move!!
8+
4. You will then have all the lessons directories under here
9+
5. Back in the project parent directory, first make sure python -V shows 3.7.x
10+
6. If not, download and install python 3.7 and be sure it is the first python on your path
11+
7. Run python -m venv venv
12+
8. Always source venv/bin/activate (mac/Liux) or venv\Scripts\activate (windows)
13+
9. run pip install -r requirements.txt (you only need to do this once after install)
14+
10. Take a look in the sample directory to see how to run python, pytest, pylint, and coverage,
15+
and how to use import in your tests and modules
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
To place all your files where running and testing work smoothly
2+
3+
1. All modules go in src
4+
2. All tests go in tests
5+
3. cd in to tests
6+
4. Run with python xxx.py
7+
5. Lint with pytest --pylint
8+
6. test with python -m pytest -vv --cov=. ../tests/
9+
10+
Note - I like to import a module I have written with import modulename
11+
Then, I call a function in that module with modulename.functionname()
12+
13+
More typing - yes (but your editor / IDE will help). Clearer - YES!
14+
15+
See examples.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
I am test_a.py in students/yourname/lessons/lesson99/assignments/src
3+
run me from students/yourname/lessons/lesson99/assignments/src
4+
run me with python a.py
5+
6+
"""
7+
8+
import b
9+
import c
10+
11+
def main():
12+
print("in A")
13+
b.print_mess("BBBBBB")
14+
c.show_mess("CCCCC")
15+
16+
if __name__ == "__main__":
17+
main()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def print_mess(message):
2+
print(message)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def show_mess(message):
2+
print(message)
3+
4+
def missed():
5+
print(0)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""
2+
3+
I am test_a.py in students/yourname/lessons/lesson99/assignments/tests
4+
run me from students/yourname/lessons/lesson99/assignments/src
5+
6+
7+
Linting:
8+
pytest --pylint
9+
10+
Test and coverage:
11+
python -m pytest -vv --cov=. ../tests/
12+
13+
14+
Note my import conventions. Verbose maybe, but it makes it
15+
COMPLETELY CLEAR where the imported funcitonlaity comes from
16+
17+
"""
18+
19+
import pytest
20+
import a
21+
import b
22+
import c
23+
24+
25+
def test_a():
26+
a.main()
27+
assert 1 == 1
28+
29+
def test_b():
30+
b.print_mess("B")
31+
assert 2 == 2
32+
33+
def test_c():
34+
c.show_mess("C")
35+
assert 3 == 3

0 commit comments

Comments
 (0)