RCPiCar: Radio-controlled Raspberry Pi Car - Library
Project description
RCPiCar: Radio-controlled Raspberry Pi Car - Library
Development
Set up
- Create a venv directory by running
./make.py venvand do not forget to activate it before the next step. - Install the project and its dependencies by running
pip install --editable .[tests].
Static type checking
This project uses static type checking using mypy.
You can run the static type checker by running ./make.py check_type.
Only if the exit code is 0, then the typing is okay.
Code style
This project tries to enforce a uniform code style.
You can run the style checker by running ./make.py check_style.
Only if the exit code is 0, then the code style is okay.
Tests
You can run the test suite by running ./make.py test.
Only if the exit code is 0, then all tests passed.
This will also print the code and branch coverage and creates a coverage report in ./htmlcov.
Build
You can build the project for deployment by running ./make.py build.
Only if the exit code is 0, then the build was successful.
Upload
You can upload the project to PyPI by running ./make.py upload.
Only if the exit code is 0, then the upload was successful.
Set up PyCharm
- At first set up the project as described above.
- Run
./make.py buildsuccessfully. - Open the project in PyCharm and configure it to use the interpreter of the venv.
- You may mark the following directories as Excluded:
./.mypy_cache./.pytest_cache./build./dist./htmlcov./src/*.egg-info./venv
- Mark the
./stubsdirectory as Sources Root - Run Configurations should automatically be imported from the
./.rundirectory.
Best practices
- Only specify the type if mypy and/or PyCharm cannot automatically infer the type.
- For example PyCharm cannot infer the generic type of for example
self.socket = Placeholder[Socket](). Therefore, please writeself.socket: Placeholder[Socket] = Placeholder()instead.
- For example PyCharm cannot infer the generic type of for example
- Third-party libraries often do not provide type information, but you can create stub files (
*.pyi) in the./stubsdirectory for it. - Please use the type
Anyor typeCallablewith ellipsis...as argument types only if there is no other way or if it is actually correct. - To decrease complexity, please consider:
- Use composition over inheritance.
- Separation of concerns: Each class has exactly one purpose.
- Keep the line count of each file small.
- Keep your dependencies small:
- Try to avoid third-party libraries and use python's standard library instead.
- Never use
import module. Import everything explicitly usingfrom module import somethingto keep the dependencies the smallest possible. - Use relative imports to import from other project files.
- Please use those rules for import at the top of each file:
- First, import python standard packages and third-party libraries ordered alphabetically by package name.
- Afterwards, import other project files ordered by relative distance (from innermost e.g.
from .Lazy import Lazyto outermost e.g.from ..util.Lazy import Lazy) and alphabetically by package name.
- Please do not use method decorators except of course
@abstractmethod,@propertyand@staticmethod.
Links
Here is an example on how this library can be used.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rcpicar-0.0.2.tar.gz.
File metadata
- Download URL: rcpicar-0.0.2.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6df6a139b7e34eaec3b2dff8490f76f64c688f629ab1d120276e2b9a3b0ae59
|
|
| MD5 |
823e2e712efcce217f80d8e0556c804c
|
|
| BLAKE2b-256 |
12fa6bbede6704a6e318d8e2136e5e222e99a4ebc60e7c88656d4b9fcad280e5
|
File details
Details for the file rcpicar-0.0.2-py3-none-any.whl.
File metadata
- Download URL: rcpicar-0.0.2-py3-none-any.whl
- Upload date:
- Size: 65.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3b5a94824949ef5737a1a848a816b36732cb9d3df6e96fc0bfa4ab463e6ae18
|
|
| MD5 |
8a9f4071ca8fc975e3c24a012be74387
|
|
| BLAKE2b-256 |
c27464185cde8d6f85a11c5ff682842705ff6943664ed7d7546fc5229ccbb7c9
|