Skip to content

Commit 103a249

Browse files
authored
Merge pull request #3 from MITLibraries/update-initial-app-name
Update initial app name
2 parents d735129 + a791611 commit 103a249

File tree

11 files changed

+20
-13
lines changed

11 files changed

+20
-13
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y git
99
COPY Pipfile* /
1010
RUN pipenv install
1111

12-
ENTRYPOINT ["pipenv", "run", "app"]
12+
ENTRYPOINT ["pipenv", "run", "my_app"]

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ update: install ## Update all Python dependencies
1313
### Test commands ###
1414

1515
test: ## Run tests and print a coverage report
16-
pipenv run coverage run --source=app -m pytest -vv
16+
pipenv run coverage run --source=my_app -m pytest -vv
1717
pipenv run coverage report -m
1818

1919
coveralls: test
@@ -24,13 +24,13 @@ coveralls: test
2424
lint: bandit black mypy pylama safety ## Run linting, code quality, and safety checks
2525

2626
bandit:
27-
pipenv run bandit -r app
27+
pipenv run bandit -r my_app
2828

2929
black:
3030
pipenv run black --check --diff .
3131

3232
mypy:
33-
pipenv run mypy app
33+
pipenv run mypy my_app
3434

3535
pylama:
3636
pipenv run pylama --options setup.cfg

Pipfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ coveralls = "*"
1515
mypy = "*"
1616
pylama = {extras = ["all"], version = "*"}
1717
pytest = "*"
18+
pyflakes = "==2.4.0"
1819

1920
[requires]
2021
python_version = "3.10"
2122

2223
[scripts]
23-
app = "python -c \"from app.cli import main; main()\""
24+
my_app = "python -c \"from my_app.cli import main; main()\""

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A template repository for creating Python CLI applications.
44

55
## App setup (delete this section and above after initial application setup)
66

7-
1. Rename "app" to the desired app name across the repo. (May be helpful to do a project-wide find-and-replace).
7+
1. Rename "my_app" to the desired app name across the repo. (May be helpful to do a project-wide find-and-replace).
88
2. Update Python version if needed.
99
3. Install all dependencies with `make install` to create initial Pipfile.lock with latest dependency versions.
1010
4. Add initial app description to README and update initial required ENV variable documentation as needed.
@@ -20,7 +20,7 @@ A template repository for creating Python CLI applications.
2020
- Create an alert for the prod environment only, with notifications sent to the appropriate team(s).
2121
- If *not* using Sentry, delete Sentry configuration from config.py and test_config.py, and remove sentry_sdk from project dependencies.
2222

23-
# app
23+
# my_app
2424

2525
Description of the app
2626

@@ -30,7 +30,7 @@ Description of the app
3030
- To update dependencies: `make update`
3131
- To run unit tests: `make test`
3232
- To lint the repo: `make lint`
33-
- To run the app: `pipenv run app --help`
33+
- To run the app: `pipenv run my_app --help`
3434

3535
## Required ENV
3636

app/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

my_app/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""my_app package."""

app/cli.py renamed to my_app/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import click
66

7-
from app.config import configure_logger, configure_sentry
7+
from my_app.config import configure_logger, configure_sentry
88

99
logger = logging.getLogger(__name__)
1010

app/config.py renamed to my_app/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def configure_logger(logger: logging.Logger, verbose: bool) -> str:
1212
)
1313
logger.setLevel(logging.DEBUG)
1414
for handler in logging.root.handlers:
15-
handler.addFilter(logging.Filter("app"))
15+
handler.addFilter(logging.Filter("my_app"))
1616
else:
1717
logging.basicConfig(
1818
format="%(asctime)s %(levelname)s %(name)s.%(funcName)s(): %(message)s"

setup.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ ignore = C0114,C0116,D100,D103,W0012
1111
linters = eradicate,isort,mccabe,pycodestyle,pydocstyle,pyflakes,pylint
1212
max_line_length = 90
1313

14+
[pylama:isort]
15+
profile = black
16+
17+
[pylama:pydocstyle]
18+
convention = pep257
19+
1420
[tool:pytest]
1521
log_level = DEBUG
1622

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from app.cli import main
1+
from my_app.cli import main
22

33

44
def test_cli_no_options(caplog, runner):

0 commit comments

Comments
 (0)