Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: tweak project settings #48

Merged
merged 6 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: CondeNast/conventional-pull-request-action@main
- uses: CondeNast/conventional-pull-request-action@v0.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
recursive-include src/package
recursive-include src/package *

exclude .gitignore .pre-commit-config.yaml
exclude CHANGELOG.md MANIFEST.in
exclude CHANGELOG.md MANIFEST.in UPSTREAM_README.md UPSTREAM_CHANGELOG.md
exclude commitlint.rules.js mypy.ini pylintrc pyproject.toml tox.ini
recursive-exclude .github *
recursive-exclude docs *
Expand Down
4 changes: 3 additions & 1 deletion UPSTREAM_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ If you’d like to start your own Python project from scratch, you can either co

- Rename the `src/package/` folder to whatever your own package’s name will be, and adjust the Github Actions in `.github/workflows/`, `setup.py`, `pyproject.toml`, `pre-commit-config.yaml` and the unit tests accordingly.

- Adjust the content of the `setup.py` file according to your needs, and reset the package’s version number in `src/package/__init__.py`. Don’t forget to delete the content of the `CHANGELOG.md` file (except for the first placeholder line).
- Adjust the content of the `setup.py` file according to your needs, and make sure to fill in the project URL, maintainer and author information too. Don’t forget to reset the package’s version number in `src/package/__init__.py`.

- If you import packages that do not provide type hints into your new repository, then `mypy` needs to be configured accordingly: add these packages to the `mypy.ini` file using the [`ignore-missing-imports`](https://mypy.readthedocs.io/en/stable/config_file.html#confval-ignore_missing_imports) option.

- If you’d like to publish your package to PyPI then set the `upload_to_pypi` variable in the `pyproject.toml` file to `true`.

Expand Down
11 changes: 8 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# get consistent results on any platform.
python_version=3.9
platform=linux
mypy_path = src
mypy_path=src
exclude=

# Useful settings.
show_column_numbers=True
Expand All @@ -16,9 +17,13 @@ warn_return_any=True
warn_redundant_casts=True
warn_unused_ignores=True

# Ignore the following imports because they have no types available.
[mypy-pytest]
ignore_missing_imports=True

# Per-module options: strict checks.
[mypy-src.*]
disallow_untyped_calls=True
disallow_untyped_defs=True
disallow_incomplete_defs = True
disallow_untyped_decorators = True
disallow_incomplete_defs=True
disallow_untyped_decorators=True
24 changes: 14 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,33 @@
description="",
long_description=README,
long_description_content_type="text/markdown",
url="",
author="",
author_email="",
# maintainer=
# maintainer_email=
url="https://project.url/",
jenstroeger marked this conversation as resolved.
Show resolved Hide resolved
author="Author",
author_email="author@email",
maintainer="Maintainer",
maintainer_email="maintainer@email",
license=LICENSE,
# https://pypi.org/classifiers/
classifiers=[
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
],
python_requires=">=3.9",
keywords="",
project_urls={
"Homepage": "https://foo.bar/",
},
package_dir={"": "src"},
packages=setuptools.find_packages(where="src"),
python_requires=">=3.9",
package_dir={"": "src"},
package_data={
"package": ["py.typed"],
},
include_package_data=True,
install_requires=[],
extras_require={
Expand All @@ -65,9 +72,6 @@
],
"docs": ["sphinx==4.3.1"],
},
package_data={
"package": ["py.typed"],
},
options={},
platforms="",
zip_safe=False,
Expand Down
5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
[tox]
envlist = py39,py310

# Ensure that tox runs Github Actions properly.
# https://github.com/ymyzk/tox-gh-actions
[gh-actions]
python =
3.9: py39
3.10: py310

# Use pytest for testing and set up an optional environment for it.
[testenv]
extras = test
commands = pytest
setenv =
SOME_VAR = "value"

# Unfortunately, flake8 does not support pyproject.toml configuration.
# https://github.com/PyCQA/flake8/issues/234
Expand Down