Skip to content

Commit 83be008

Browse files
authored
Merge branch 'master' into patch-1
2 parents ff473ce + 1f616b5 commit 83be008

File tree

448 files changed

+237664
-1348
lines changed

Some content is hidden

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

448 files changed

+237664
-1348
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)

.dependabot/config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
:information_source: Please note that the best way to get support for Real Python courses & articles is to join one of our [weekly Office Hours calls](https://realpython.com/office-hours/) or in the [RP Community Slack](https://realpython.com/community/).
11+
12+
You can report issues and problems here, but we typically won't be able to provide 1:1 support outside the channels listed above.
13+
14+
**Describe the bug**
15+
A clear and concise description of what the bug is.
16+
17+
**To Reproduce**
18+
Steps to reproduce the behavior:
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Screenshots**
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Desktop (please complete the following information):**
31+
- OS: [e.g. iOS]
32+
- Browser [e.g. chrome, safari]
33+
- Version [e.g. 22]
34+
35+
**Smartphone (please complete the following information):**
36+
- Device: [e.g. iPhone6]
37+
- OS: [e.g. iOS8.1]
38+
- Browser [e.g. stock browser, safari]
39+
- Version [e.g. 22]
40+
41+
**Additional context**
42+
Add any other context about the problem here.

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
open-pull-requests-limit: 10
8+
allow:
9+
- dependency-name: flake8
10+
- dependency-name: black

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,6 @@ ENV/
108108

109109
# Mac
110110
*.DS_Store
111+
112+
# VS Code workspace
113+
*.code-workspace

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# Real Python Materials
22

3-
Bonus materials, exercises, and example projects for our [Python tutorials](https://realpython.com).
3+
Bonus materials, exercises, and example projects for Real Python's [Python tutorials](https://realpython.com).
44

55
Build Status: [![CircleCI](https://circleci.com/gh/realpython/materials.svg?style=svg)](https://circleci.com/gh/realpython/materials)
66

7-
## Running Code Style Checks
7+
## Got a Question?
8+
9+
The best way to get support for Real Python courses & articles and code in this repository is to join one of our [weekly Office Hours calls](https://realpython.com/office-hours/) or to ask your question in the [RP Community Slack](https://realpython.com/community/).
10+
11+
Due to time constraints we cannot provide 1:1 support via GitHub. See you on Slack or on the next Office Hours call 🙂
12+
13+
## Adding Source Code & Sample Projects to This Repo (RP Contributors)
14+
15+
### Running Code Style Checks
816

917
We use [flake8](http://flake8.pycqa.org/en/latest/) and [black](https://github.com/ambv/black) to ensure a consistent code style for all of our sample code in this repository.
1018

@@ -15,7 +23,7 @@ $ flake8
1523
$ black --check .
1624
```
1725

18-
## Running Python Code Formatter
26+
### Running Python Code Formatter
1927

2028
We're using a tool called [black](https://github.com/ambv/black) on this repo to ensure consistent formatting. On CI it runs in "check" mode to ensure any new files added to the repo are following PEP 8. If you see linter warnings that say something like "would reformat some_file.py" it means black disagrees with your formatting.
2129

arcade-a-primer/arcade_basic_oop.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414

1515

1616
class Welcome(arcade.Window):
17-
"""Our main welcome window
18-
"""
17+
"""Our main welcome window"""
1918

2019
def __init__(self):
21-
"""Initialize the window
22-
"""
20+
"""Initialize the window"""
2321

2422
# Call the parent class constructor
2523
super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
@@ -28,8 +26,7 @@ def __init__(self):
2826
arcade.set_background_color(arcade.color.WHITE)
2927

3028
def on_draw(self):
31-
"""Called whenever we need to draw our window
32-
"""
29+
"""Called whenever we need to draw our window"""
3330

3431
# Clear the screen and start drawing
3532
arcade.start_render()

arcade-a-primer/arcade_draw_shapes.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313

1414

1515
class Welcome(arcade.Window):
16-
"""Our main welcome window
17-
"""
16+
"""Our main welcome window"""
1817

1918
def __init__(self):
20-
"""Initialize the window
21-
"""
19+
"""Initialize the window"""
2220

2321
# Call the parent class constructor
2422
super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
@@ -27,8 +25,7 @@ def __init__(self):
2725
arcade.set_background_color(arcade.color.WHITE)
2826

2927
def on_draw(self):
30-
"""Called whenever we need to draw our window
31-
"""
28+
"""Called whenever we need to draw our window"""
3229

3330
# Clear the screen and start drawing
3431
arcade.start_render()

arcade-a-primer/arcade_game.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ class SpaceShooter(arcade.Window):
4141
"""
4242

4343
def __init__(self, width: int, height: int, title: str):
44-
"""Initialize the game
45-
"""
44+
"""Initialize the game"""
4645
super().__init__(width, height, title)
4746

4847
# Setup the empty sprite lists
@@ -51,8 +50,7 @@ def __init__(self, width: int, height: int, title: str):
5150
self.all_sprites = arcade.SpriteList()
5251

5352
def setup(self):
54-
"""Get the game ready to play
55-
"""
53+
"""Get the game ready to play"""
5654

5755
# Set the background color
5856
arcade.set_background_color(arcade.color.SKY_BLUE)
@@ -236,8 +234,7 @@ def on_update(self, delta_time: float):
236234
self.player.left = 0
237235

238236
def on_draw(self):
239-
"""Draw all game objects
240-
"""
237+
"""Draw all game objects"""
241238

242239
arcade.start_render()
243240
self.all_sprites.draw()

0 commit comments

Comments
 (0)