|
1 | 1 | # PythonTemplateRepo |
2 | 2 |
|
3 | | - |
| 3 | +Template repo for getting started with a Python project. |
4 | 4 |
|
5 | | -This is a basic README template. Feel free to customise it to your liking. |
| 5 | +## Getting started |
6 | 6 |
|
7 | | -## Features |
| 7 | +To get started, click on the `Use this template` at the top-right of the screen, then enter your project's name and any other info you want. |
8 | 8 |
|
9 | | -- Feature 1 |
10 | | -- Feature 2 |
| 9 | +You might see that some GitHub Actions runs will fail. This is normal. After some tweaking to them, they will work as your expect them to be, but you can choose to deal with that once you're all done. |
11 | 10 |
|
12 | | -[See the documentation](../docs/) for more. |
| 11 | +## Directories |
13 | 12 |
|
14 | | -## Options to run |
| 13 | +### docs/ |
15 | 14 |
|
16 | | -You can run the program from source or use a pre-compiled binary. |
| 15 | +The `docs` directory is the documentation folder. In Python, we can use `MkDocs` to make easy documentation without having to spend time on making a fancy site. MkDocs uses Markdown (.md) files placed in the `docs` directory to output a site that can be used as your documentation site for your program. It has many themes and plugins that you can choose from; though beware that to install those themes, you will have to install their libraries akin to running the author's code. |
17 | 16 |
|
18 | | -Pre-compiled binaries are available either from the Releases tab (if the developer chooses to add them there) or after each push from the Actions tab (GitHub account required). Please be aware that using binaries from the Actions tab is very dangerous, as it is considered untested software. |
| 17 | +For more information, [visit MkDocs' website](https://www.mkdocs.org/). |
19 | 18 |
|
20 | | -To run the program from source, you'll need to have the following prerequisites: |
| 19 | +### tests/ |
21 | 20 |
|
22 | | -- Python 3.11 <!-- Change this to the version of Python this is being developed in --> |
23 | | -- Git (note that this is not a necessary but it's often best to have such) |
| 21 | +The `tests` directory is the unit tests folder, where all your unit tests will go. In Python, we can use `pytest` to have our code tested before setting it for production. You can ad tests by creating a folder named `test_` and then your script's name, for example, `test_main`. Inside, place a blank `__init__.py` file to let Python know that this is a module, and then you can run `pytest` in your terminal and see if your tests have passed or failed. |
24 | 22 |
|
25 | | -- Clone this repository using: |
| 23 | +For more information on Pytest, [visit Pytest's docs](https://docs.pytest.org/en/stable/). |
26 | 24 |
|
27 | | -```bash |
28 | | -git clone https://github.com/{username}/{repo} |
29 | | -``` |
| 25 | +To learn about test-driven development, [Wikipedia is a good starting point](https://en.wikipedia.org/wiki/Test-driven_development) |
30 | 26 |
|
31 | | -- Then, setup a virtual environment: |
| 27 | +### images/ |
32 | 28 |
|
33 | | -```bash |
34 | | -python -m venv venv |
35 | | -venv\scripts\activate |
36 | | -pip install -r requirements.txt |
37 | | -``` |
| 29 | +The `images` directory is where you can store images you want to use. You can have app icons, badges, anything that has an image into that folder. |
38 | 30 |
|
39 | | -- Finally, run the necessary command for your situation: |
| 31 | +### .vscode/ |
40 | 32 |
|
41 | | -```bash |
42 | | -# Running the program itself |
43 | | -python main.py |
44 | | -# Viewing the MkDocs site |
45 | | -mkdocs serve |
46 | | -# Freezing the application |
47 | | -pyinstaller --onefile main.py |
48 | | -``` |
| 33 | +The `.vscode` folder contains stuff that can only be used in Visual Studio Code (and any forks of its kind). This includes: |
49 | 34 |
|
50 | | -And all done! |
| 35 | +- `/extensions.json` - Recommended VSCode extensions to use. |
| 36 | +- `launch.json` - Debug launch configs for VSCode. |
| 37 | + |
| 38 | +### .github/ |
| 39 | + |
| 40 | +The `.github` folder contains GitHub-related stuff, such as: |
| 41 | + |
| 42 | +- `/workflows` - GitHub Actions workflow files that tells GitHub's runners how to behave on certain events. |
| 43 | +- `/dependabot.yml` - Dependabot's configuration file, which tells it what to update and how/where. [Learn more about Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot). |
| 44 | +- `/README.md` - not actually something specific to GitHub, but it's an actual README file that you're welcome to take and adapt for your own project, to use over this README file. Remember to delete this after you fork the repo and start making changes! |
0 commit comments