Skip to content

Commit c13cb70

Browse files
authored
Merge branch 'master' into python-flask-example-heroku
2 parents e1ddc70 + ceb25cd commit c13cb70

File tree

272 files changed

+129669
-28
lines changed

Some content is hidden

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

272 files changed

+129669
-28
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ jobs:
3939
. venv/bin/activate
4040
flake8
4141
black --check .
42+
43+
- run:
44+
name: Directory layout check
45+
command: |
46+
. venv/bin/activate
47+
python .circleci/dircheck.py

.circleci/dircheck.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
"""
2+
Linter to ensure standard folder structure
3+
"""
4+
import pathlib
5+
import re
6+
import sys
7+
8+
IGNORELIST = {
9+
"venv",
10+
"asyncio-walkthrough",
11+
"build-a-gui-with-wxpython",
12+
"consuming-apis-python",
13+
"flask-connexion-rest-part-3",
14+
"flask-connexion-rest-part-4",
15+
"generators",
16+
"intro-to-threading",
17+
"introduction-combining-data-pandas-merge-join-and-concat",
18+
"linked-lists-python",
19+
"nearbyshops",
20+
"oop-in-java-vs-python",
21+
"opencv-color-spaces",
22+
"openpyxl-excel-spreadsheets-python",
23+
"pygame-a-primer",
24+
"pyqt-calculator-tutorial",
25+
"python-dash",
26+
"python-eval-mathrepl",
27+
"rp-portfolio",
28+
"storing-images",
29+
"understanding-asynchronous-programming",
30+
}
31+
FOLDER_NAME_RE = re.compile(r"^[-a-z0-9]{5,}\Z")
32+
33+
has_errors = False
34+
35+
for f in sorted(pathlib.Path(".").glob("*")):
36+
if not f.is_dir():
37+
continue
38+
if str(f).startswith("."):
39+
continue
40+
if str(f) in IGNORELIST:
41+
continue
42+
43+
if not FOLDER_NAME_RE.search(str(f)):
44+
print(
45+
f"{f}: ensure folder name only uses "
46+
f"lowercase letters, numbers, and hyphens"
47+
)
48+
has_error = True
49+
50+
files = sorted(_.name for _ in f.glob("*"))
51+
if "README.md" not in files:
52+
print(f"{f}: no README.md found")
53+
has_errors = True
54+
55+
if has_errors:
56+
print(
57+
"""-----------------------
58+
Please ensure new sample projects are added using the correct
59+
folder structure:
60+
61+
* New files should go into a top-level subfolder, named after the
62+
article slug (lowercase, dashes). For example: my-awesome-article/
63+
64+
* Top-level sample project folders should contain a README.md file.
65+
For example: my-awesome-article/README.md
66+
67+
This helps us keep the repo clean and easy to browse on GitHub.
68+
69+
Thanks!
70+
"""
71+
)
72+
sys.exit(1)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Build an Asteroids Game With Python and Pygame
2+
3+
The code in this folder supplements the tutorial [Build an Asteroids Game With Python and Pygame](https://realpython.com/asteroids-game-python/).
4+
5+
There are eleven subfolders: one for each of the ten steps in the project and one with the final source code of the full game.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
venv
2+
*.pem
3+
*.pem
4+
*.pyc
5+
__pycache__
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Space Rocks
2+
3+
A simple space game made with Python and Pygame
4+
5+
## Installation
6+
7+
Requires Python 3.
8+
9+
```
10+
pip install -r requirements.txt
11+
python space_rocks
12+
```
Binary file not shown.
13.1 KB
Loading
248 Bytes
Loading
428 KB
Loading
2.39 KB
Loading

0 commit comments

Comments
 (0)