Skip to content

Commit

Permalink
refactor: use 'slug', fix mypy path
Browse files Browse the repository at this point in the history
  • Loading branch information
dtbuchholz committed Apr 22, 2024
1 parent 425d3e1 commit 7f6a9d7
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 14 deletions.
3 changes: 1 addition & 2 deletions cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"project_name": "",
"description": "",
"hyphenated": "{{ '-'.join(cookiecutter['project_name'].lower().split()).replace('_', '-') }}",
"underscored": "{{ cookiecutter.hyphenated.replace('-', '_') }}",
"slug": "{{ '_'.join(cookiecutter['project_name'].lower().split()) }}",
"github_username": "",
"author_name": ""
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# {{ cookiecutter.hyphenated }}
# {{ cookiecutter.project_name }}

[![PyPI](https://img.shields.io/pypi/v/{{ cookiecutter.hyphenated }}.svg)](https://pypi.org/project/{{ cookiecutter.hyphenated }}/){% if cookiecutter.github_username %}
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.hyphenated }}/blob/main/LICENSE){% endif %}
[![PyPI](https://img.shields.io/pypi/v/{{ cookiecutter.slug }}.svg)](https://pypi.org/project/{{ cookiecutter.slug }}/){% if cookiecutter.github_username %}
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.slug }}/blob/main/LICENSE){% endif %}
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme)

> {{ cookiecutter.description }}
Expand All @@ -15,19 +15,19 @@ Background information goes here.
You can install with `pip`:

```sh
pip install {{ cookiecutter.hyphenated }}
pip install {{ cookiecutter.slug }}
```

With `poetry`:

```sh
poetry add {{ cookiecutter.hyphenated }}
poetry add {{ cookiecutter.slug }}
```

Or with `pipenv`:

```sh
pipenv install {{ cookiecutter.hyphenated }}
pipenv install {{ cookiecutter.slug }}
```

## Usage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[tool.poetry]
name = "{{ cookiecutter.hyphenated }}"
version = "0.0.0"
requires-python = ">=3.11"
name = "{{ cookiecutter.slug }}"
version = "0.0.1"
description = "{{ cookiecutter.description or "" }}"
authors = [{name = "{{ cookiecutter.author_name }}"}]
authors = ["{{ cookiecutter.author_name }}"]
license = "Apache-2.0"
classifiers = [
"License :: OSI Approved :: Apache Software License"
Expand Down Expand Up @@ -51,7 +50,7 @@ use_parentheses = true
line_length = 88

[tool.mypy]
files = ["{{ cookiecutter.hyphenated }}", "test"]
files = ["src/{{ cookiecutter.slug }}", "test"]
ignore_missing_imports = false

[tool.pytest.ini_options]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from {{ cookiecutter.underscored }} import example_function
from {{ cookiecutter.slug }} import example_function


def test_example_function():
Expand Down

0 comments on commit 7f6a9d7

Please sign in to comment.