Skip to content

Commit

Permalink
Update so all files are ruff checked.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwww committed Aug 21, 2024
1 parent e2a2867 commit bf7eeec
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: uv run ruff format --check

- name: Ruff lint/sort/etc checking
run: uv run ruff check --no-fix elkm1_lib test
run: uv run ruff check --no-fix

- name: Run pylint
run: uv run pylint elkm1_lib
Expand Down
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ clean:
rm -rf build dist *.egg-info

install:
poetry install
uv sync

build:
poetry build
format:
ruff format

upload.test: build
poetry publish --repository test

upload: build
poetry publish

isort:
sh -c "isort --skip-glob=.tox ."
check:
ruff check --no-fix

lint:
pylint --msg-template='{msg_id}({symbol}):{line:3d},{column}: {obj}: {msg}' elkm1_lib
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ and the call to `Elk` changes to:
```

The following ElkM1 connection protocols are supported:

- serial:// - Serial port;
- elk:// - Elk M1XEP Ethernet, non-secure
- elks:// - Elk M1XEP Ethernet, secure, TLS 1.0
Expand Down Expand Up @@ -185,25 +186,27 @@ command for light number 3 (light 4 on the panel -- remember 0
versus 1 base).

All of the commands that send messages to the panel are automatically
discovered and are all the XX_encode functions in the ``elkm1_lib.message``
discovered and are all the XX_encode functions in the `elkm1_lib.message`
module. The docstring and the XX_encode's parameters are shown as part
of the help.

## Development

This project uses [poetry](https://poetry.eustace.io/) for development dependencies. Installation instructions are on their website.
This project uses [uv](https://astral.sh/blog/uv-unified-python-packaging) for development dependencies.
Installation instructions are on their website. Other tools used by development are installed as part of
the development dependencies.

To get started developing:

```
git clone https://github.com/gwww/elkm1.git
cd elkm1
poetry install
poetry shell # Or activate the created virtual environment
uv sync
# Activate the created virtual environment according to the shell you are using.
make test # to ensure everything installed properly
```

There is a `Makefile` in the root directory as well. The `make` command
There is a `Makefile` in the root directory. The `make` command
followed by one of the targets in the `Makefile` can be used. If you don't
have or wish to use `make` the `Makefile` serves as examples of common
commands that can be run.
Expand All @@ -213,6 +216,7 @@ commands that can be run.
No problem ;) — report the bugs! But, logs are most often required. If you
are using Home Assistant, which is about the only use I'm aware of for
this library, then add the following to your `configuration.yaml`:

```
logger:
default: info
Expand Down
4 changes: 2 additions & 2 deletions bin/cmdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def print_elements(self, cmd, args):
if args[1] in self.element_cmds[cmd][3]:
fn = self.element_cmds[cmd][3][args[1]][0]
else:
raise NotImplemented
raise NotImplementedError
for i in args[0]:
print(fn)
fn(element_list[i], *args[2])
Expand Down Expand Up @@ -296,7 +296,7 @@ class Exit(object):
def __init__(
self,
title,
command_caption="Command: (Tab to switch focus to upper frame, where you can scroll text)",
command_caption="Command: (Tab to switch focus to upper frame)",
cmd_cb=None,
max_size=1000,
):
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def main():
if not url:
print("Specify url to connect to in ELKM1_URL environment variable")
exit(0)
myapp = MyApp(url, 8813)
_ = MyApp(url, 8813)


if __name__ == "__main__":
Expand Down

0 comments on commit bf7eeec

Please sign in to comment.