Skip to content

Commit

Permalink
Rename main module and command to ccslips
Browse files Browse the repository at this point in the history
  • Loading branch information
hakbailey committed Feb 17, 2023
1 parent f6646c9 commit 065c10c
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y git
COPY Pipfile* /
RUN pipenv install

ENTRYPOINT ["pipenv", "run", "cc-slips"]
ENTRYPOINT ["pipenv", "run", "ccslips"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ update: install ## Update all Python dependencies
### Test commands ###

test: ## Run tests and print a coverage report
pipenv run coverage run --source=cc_slips -m pytest -vv
pipenv run coverage run --source=ccslips -m pytest -vv
pipenv run coverage report -m

coveralls: test
Expand All @@ -31,13 +31,13 @@ coveralls: test
lint: bandit black mypy pylama safety ## Run linting, code quality, and safety checks

bandit:
pipenv run bandit -r cc_slips
pipenv run bandit -r ccslips

black:
pipenv run black --check --diff .

mypy:
pipenv run mypy cc_slips
pipenv run mypy ccslips

pylama:
pipenv run pylama --options setup.cfg
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ pytest = "*"
python_version = "3.11"

[scripts]
cc-slips = "python -c \"from cc_slips.cli import main; main()\""
ccslips = "python -c \"from ccslips.cli import main; main()\""
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ A CLI application to generate and email credit card slips for Alma invoices via
- To update dependencies: `make update`
- To run unit tests: `make test`
- To lint the repo: `make lint`
- To run the app: `pipenv run cc-slips --help`
- To run the app: `pipenv run ccslips --help`

## ENV Variables

- `LOG_LEVEL` = Optional, set to a valid Python logging level (e.g. `DEBUG`, case-insensitive) if desired. Can also be passed as an option directly to the cc-slips command. Defaults to `INFO` if not set or passed to the command.
- `LOG_LEVEL` = Optional, set to a valid Python logging level (e.g. `DEBUG`, case-insensitive) if desired. Can also be passed as an option directly to the ccslips command. Defaults to `INFO` if not set or passed to the command.
- `SENTRY_DSN` = If set to a valid Sentry DSN, enables Sentry exception monitoring. This is not needed for local development.
- `WORKSPACE` = Set to `dev` for local development, this will be set to `stage` and `prod` in those environments by Terraform.
1 change: 0 additions & 1 deletion cc_slips/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions ccslips/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""ccslips package."""
2 changes: 1 addition & 1 deletion cc_slips/cli.py → ccslips/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import click

from cc_slips.config import configure_logger, configure_sentry
from ccslips.config import configure_logger, configure_sentry

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion cc_slips/config.py → ccslips/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def configure_logger(logger: logging.Logger, log_level_string: str) -> str:
)
logger.setLevel(log_level)
for handler in logging.root.handlers:
handler.addFilter(logging.Filter("cc_slips"))
handler.addFilter(logging.Filter("ccslips"))
else:
logging.basicConfig(
format="%(asctime)s %(levelname)s %(name)s.%(funcName)s(): %(message)s"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from freezegun import freeze_time

from cc_slips.cli import main
from ccslips.cli import main


@freeze_time("2023-01-02")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from cc_slips.config import configure_logger, configure_sentry
from ccslips.config import configure_logger, configure_sentry


def test_configure_logger_with_invalid_level_raises_error():
Expand Down

0 comments on commit 065c10c

Please sign in to comment.