development environment
setup
Download Python 3.10 if you haven’t already.
Navigate in a terminal to where you want the project’s folder to appear.
git clone https://github.com/wheelercj/note-splitter.gitto download the project’s files.cdinto the project’s folder.Create a virtual environment, such as with
py -3.10 -m venv venvorpython3.10 -m venv venv.pip install -r requirements.txtto install the app’s dependencies.pip install -r requirements-dev.txtto install the development dependencies.pre-commit installto set up pre-commit git hook scripts.
Now you can use these commands:
briefcase devto run the app in dev mode (see BeeWare Briefcase’s docs for more info if needed).pytestto run the automated tests.py src/tests/manual_test.pyorpython3 src/tests/manual_test.pyto run the manual test.coverage run -m pytestto gather test coverage data, and then:coverage report -ito view a brief test coverage report.coverage html -ito view a detailed test coverage report.
pre-commit run --all-filesto run all the pre-commit hooks without committing.pre-commit run hook-id-here --file file-path-here.pyto run one pre-commit hook on one file without committing.To locally build the documentation to test it, see how to maintain this documentation.
maintenance
when the dependencies change
update the appropriate requirements file
if the new dependency is for Note Splitter itself and not just a development dependency, add it to docs/environment.yaml
when a new Python module is added
add its name to the list in docs/modules.rst
while in the project’s root folder, use this command to automatically generate an rst file for the new module:
sphinx-apidoc -o docs src/note_splitter -e
when bumping the app’s version: search the entire project for the version to change because it is in multiple places
distribution
briefcase devto run the app in dev mode.briefcase createto create the app template.briefcase updateto copy new changes into the platform directory.briefcase update -dto update the dependencies in the packaged app.briefcase buildto compile the app.briefcase runto run the compiled app.briefcase run -uto update, build, and run the compiled app.briefcase packageto create the app’s installer for the current platform.briefcase package -uto update, build, and create the app’s installer for the current platform.
directory structure
Here are descriptions of what each of Note Splitter’s folders are for:
.
├───.github # Files to configure GitHub.
│ └── ISSUE_TEMPLATE # Issue templates.
├── docs # Files for documentation (.md and .rst) and for configuration.
│ └── images # Images used in the documentation and/or the README.
└── src
├── note_splitter # Note Splitter's source code.
│ └── resources # Note Splitter's icon files.
└── tests # Automated and manual tests.
└── assets # Files used by automated and manual tests.
further reading
You can learn more about how this program was made from our references.