Skip to content

Commit c190650

Browse files
committed
fix README and move mypy/pytest to pyproject.toml
1 parent 70af1ea commit c190650

11 files changed

+84
-100
lines changed

cookiecutter.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '-') }}",
77
"package_name": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_').replace('project', 'package') }}",
88
"module_name": "{{ cookiecutter.package_name.lower().replace(' ', '_').replace('-', '_').replace('package', 'module') }}",
9-
"project_short_description": "Python Project with some awesome tools to quickstart any Python project.",
9+
"project_short_description": "Python template with some awesome tools to quickstart any Python project.",
1010
"version": "0.1.0",
11-
"license": ["MIT", "BSD-3-Clause", "Apache-2.0", "GPL-3.0", "Proprietary"]
11+
"license": ["MIT", "BSD_3_Clause", "Apache_2.0", "GPL_3.0", "Proprietary"]
1212
}

{{cookiecutter.project_slug}}/.pre-commit-config.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: detect-aws-credentials
1414
- id: detect-private-key
1515
- id: end-of-file-fixer
16-
exclude: ^docs/
16+
files: .*\.py
1717
- id: mixed-line-ending
1818
- id: name-tests-test
1919
- repo: https://github.com/PyCQA/isort
@@ -24,8 +24,6 @@ repos:
2424
rev: v0.942
2525
hooks:
2626
- id: mypy
27-
additional_dependencies: [pydantic]
28-
exclude: noxfile.py
2927
- repo: local
3028
hooks:
3129
- id: black-formatter

{{cookiecutter.project_slug}}/LICENSE.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2020
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
23-
{% elif cookiecutter.license == 'BSD-3-Clause' %}
23+
{% elif cookiecutter.license == 'BSD_3_Clause' %}
2424

2525
BSD License
2626

@@ -51,7 +51,7 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
5151
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
5252
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
5353
OF THE POSSIBILITY OF SUCH DAMAGE.
54-
{% elif cookiecutter.license == 'Apache-2.0' -%}
54+
{% elif cookiecutter.license == 'Apache_2.0' -%}
5555
Apache Software License 2.0
5656

5757
Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }}
@@ -67,7 +67,7 @@ distributed under the License is distributed on an "AS IS" BASIS,
6767
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6868
See the License for the specific language governing permissions and
6969
limitations under the License.
70-
{% elif cookiecutter.license == 'GPL-3.0' -%}
70+
{% elif cookiecutter.license == 'GPL_3.0' -%}
7171
GNU GENERAL PUBLIC LICENSE
7272
Version 3, 29 June 2007
7373

@@ -100,6 +100,6 @@ may consider it more useful to permit linking proprietary applications with
100100
the library. If this is what you want to do, use the GNU Lesser General
101101
Public License instead of this License. But first, please read
102102
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
103-
{% elif cookiecutter.license == 'BSD-3-Clause' %}
103+
{% elif cookiecutter.license == 'Proprietary' %}
104104
Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.full_name }} all rights reserved
105105
{% endif %}

{{cookiecutter.project_slug}}/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@
7777

7878
#### Packages
7979

80-
<a href="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/packages_new_package.png">
81-
<img src="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/packages_new_package.png" alt="uml-diagram-packages">
80+
<a href="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/packages_{{cookiecutter.package_name}}.png">
81+
<img src="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/packages_{{cookiecutter.package_name}}.png" alt="uml-diagram-packages">
8282
</a>
8383

8484
---
8585

8686
#### Classes
8787

88-
<a href="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/classes_new_package.png">
89-
<img src="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/classes_new_package.png" alt="uml-diagram-classes">
88+
<a href="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/classes_{{cookiecutter.package_name}}.png">
89+
<img src="https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/raw/main/docs/uml/diagrams/classes_{{cookiecutter.package_name}}.png" alt="uml-diagram-classes">
9090
</a>
9191

9292
<p align="right">(<a href="#top">back to top</a>)</p>
@@ -195,7 +195,7 @@ Don't forget to give the project a star! Thanks again!
195195
<!-- LICENSE -->
196196
## License
197197

198-
Distributed under the {{cookiecutter.license}} License. See [`LICENSE.txt`](https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/LICENSE.txt) for more information.
198+
Distributed under the {{cookiecutter.license}} License. See [`LICENSE.txt`](https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/blob/master/LICENSE.txt) for more information.
199199

200200
<p align="right">(<a href="#top">back to top</a>)</p>
201201

@@ -239,6 +239,6 @@ References and sources of inspiration
239239
[stars-url]: https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/stargazers
240240
[issues-shield]: https://img.shields.io/github/issues/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}.svg?style=for-the-badge
241241
[issues-url]: https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/issues
242-
[license-shield]: https://img.shields.io/github/license/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}.svg?style=for-the-badge
242+
[license-shield]: https://img.shields.io/badge/license-{{cookiecutter.license}}-green?style=for-the-badge
243243
[license-url]: https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/blob/master/LICENSE.txt
244244

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
digraph "classes_new_package" {
1+
digraph "classes_my_python_package" {
22
rankdir=BT
33
charset="utf-8"
4-
"new_package.new_module.Calculator" [color="black", fontcolor="black", label="{new_package.new_module.Calculator|\l|divide(a: Real, b: Real): Real\l}", shape="record", style="solid"];
4+
"my_python_package.my_python_module.Calculator" [color="black", fontcolor="black", label="{my_python_package.my_python_module.Calculator|\l|divide(a: Real, b: Real): Real\l}", shape="record", style="solid"];
55
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
digraph "packages_new_package" {
1+
digraph "packages_my_python_package" {
22
rankdir=BT
33
charset="utf-8"
4-
"new_package" [color="black", label="new_package", shape="box", style="solid"];
5-
"new_package.new_module" [color="black", label="new_package.new_module", shape="box", style="solid"];
4+
"my_python_package" [color="black", label="my_python_package", shape="box", style="solid"];
5+
"my_python_package.my_python_module" [color="black", label="my_python_package.my_python_module", shape="box", style="solid"];
66
}
-428 Bytes
Loading
318 Bytes
Loading

{{cookiecutter.project_slug}}/poetry.lock

Lines changed: 36 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

{{cookiecutter.project_slug}}/pyproject.toml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = ["{{cookiecutter.full_name}} <{{cookiecutter.email}}>"]
88
python = "^3.9"
99

1010
[tool.poetry.dev-dependencies]
11-
pytest = "^5.2"
11+
pytest = "7.1.1"
1212
pytest-cov = "^3.0.0"
1313
pre-commit = "^2.18.1"
1414
flake8 = "^4.0.1"
@@ -68,3 +68,32 @@ exclude = '''
6868
# the root of the project
6969
)
7070
'''
71+
72+
[tool.pytest.ini_options]
73+
minversion = "6.0"
74+
addopts = "--verbose --color=yes --cov=src --cov-fail-under=100 --cov-report term-missing --doctest-modules"
75+
testpaths = [
76+
"tests",
77+
"src"
78+
]
79+
python_files = ["*_test.py"]
80+
python_functions = ["test_*"]
81+
render_collapsed = true
82+
83+
[tool.mypy]
84+
warn_return_any = false
85+
warn_unused_configs = true
86+
warn_redundant_casts = true
87+
88+
[[tool.mypy.overrides]]
89+
module = [
90+
"{{cookiecutter.package_name}}"
91+
]
92+
follow_imports = "silent"
93+
strict_optional = true
94+
warn_unused_ignores = true
95+
disallow_any_generics = true
96+
check_untyped_defs = true
97+
no_implicit_reexport = true
98+
disallow_untyped_defs = true
99+
ignore_missing_imports = true

0 commit comments

Comments
 (0)