Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add development instructions to README.md #28

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
# New project template
# FawltyDeps

Use this template when creating a new project.
A dependency checker for Python.

Find undeclared 3rd-party dependencies in your Python project.

# Installation

TODO: Fill when released in PyPI

# Usage

To check the project in the current directory run:

```
fawltydeps
```

Options available:

```
> fawltydeps --help
usage: fawltydeps [-h] [--code CODE] [-v] [-q]

Find undeclared 3rd-party dependencies in your Python project.

options:
-h, --help show this help message and exit
--code CODE Code to parse for import statements (file or directory, use '-' to read code from stdin; defaults to the current directory)
-v, --verbose Increase log level (WARNING by default, -v: INFO, -vv: DEBUG)
-q, --quiet Decrease log level (WARNING by default, -q: ERROR, -qq: FATAL)
mknorps marked this conversation as resolved.
Show resolved Hide resolved
```

# Documentation

TODO: Add design doc

[Code design](./docs/CodeDesign.md)

# Development

The project uses [Poetry](https://python-poetry.org/). Install Poetry, and run:

```
poetry shell
```

To install the project run:

```
poetry install
mknorps marked this conversation as resolved.
Show resolved Hide resolved
```

Inside the shell you have a Python virtual environment with all dependencies declared in pyproject.toml installed.
To test, typecheck and ensure code formatting you just run:

```
pytest # tests
mypy # type annotations checks
black --check # formater checks
pylint # linter
isort # import sort
```
mknorps marked this conversation as resolved.
Show resolved Hide resolved

TODO: explain how to run CI locally when [#15](https://github.com/tweag/FawltyDeps/issues/15) is completed
24 changes: 24 additions & 0 deletions docs/CodeDesign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Code design

We value composability and functional style.
We want the code to be readable, testable and maintainable. That is why we use:

- code formatter `black` to unify the code style,
- `pylint` and `isort` for linting
- `mypy` for typecheck
- `pytest` for testing
to ensure this quality.

The code must be type-annotated and functions should have docstrings.

FawltyDeps searches for imports and dependencies and to do it efficiently, generators are used.

## Tests

We do not aim for 100% coverage but to document the usecases via tests. FawltyDeps has unit and integration tests.

Tests have following naming convention:

```
test_{tested_function}__{short_description}__{expected_result}
```