Skip to content

Commit 422d3e7

Browse files
committed
Migrate to more standard repo setup
1 parent 51d0239 commit 422d3e7

File tree

13 files changed

+307
-33
lines changed

13 files changed

+307
-33
lines changed

.coveragerc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[report]
2+
fail_under = 60
3+
exclude_lines =
4+
if TYPE_CHECKING:
5+
pragma: no cover
6+
def __repr__
7+
raise AssertionError
8+
raise NotImplementedError
9+
if __name__ == .__main__.:
10+
if sys.version_info
11+
class .*\(.*(Error|Exception)\):
12+
^ *\.\.\.$
13+
14+
[run]
15+
branch = true
16+
omit =
17+
tests/data/*
18+
tests/util/*
19+
.*
20+
venv/*

.devcontainer/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.11
2+
3+
RUN \
4+
pipx uninstall pydocstyle \
5+
&& pipx uninstall pycodestyle \
6+
&& pipx uninstall mypy \
7+
&& pipx uninstall pylint \
8+
&& pipx uninstall pytest \
9+
&& pipx uninstall flake8 \
10+
&& pipx uninstall black
11+
12+
ENV SHELL /bin/bash

.devcontainer/devcontainer.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python 3",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"dockerFile": "./Dockerfile",
7+
"context": "..",
8+
"features": {
9+
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
10+
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions"
11+
}
12+
},
13+
14+
// Features to add to the dev container. More info: https://containers.dev/features.
15+
// "features": {},
16+
17+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
18+
// "forwardPorts": [],
19+
20+
// Use 'postCreateCommand' to run commands after the container is created.
21+
"postCreateCommand": "pip3 install -Ur requirements.txt",
22+
// Configure tool-specific properties.
23+
// "customizations": {},
24+
25+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
26+
// "remoteUser": "root",
27+
"customizations": {
28+
"vscode": {
29+
"extensions": [
30+
"tamasfe.even-better-toml",
31+
"ms-python.python",
32+
"ms-python.vscode-pylance",
33+
"EditorConfig.EditorConfig",
34+
"GitHub.vscode-pull-request-github"
35+
],
36+
"settings": {
37+
"python.pythonPath": "/usr/local/bin/python",
38+
"python.testing.pytestArgs": ["--no-cov"],
39+
"terminal.integrated.profiles.linux": {
40+
"zsh": {
41+
"path": "/usr/bin/zsh"
42+
}
43+
},
44+
"terminal.integrated.defaultProfile.linux": "zsh"
45+
}
46+
}
47+
}
48+
}

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is the top-most .editorconfig file; do not search in parent directories.
2+
root = true
3+
4+
# All files.
5+
[*]
6+
end_of_line = LF
7+
indent_style = space
8+
indent_size = 4
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
[*.{yml,yaml}]
14+
indent_size = 2

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.pre-commit-config.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
exclude: ^\.vscode/.*$
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
5+
hooks:
6+
- id: trailing-whitespace
7+
args: ['--markdown-linebreak-ext=md,markdown']
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: check-ast
12+
- id: check-byte-order-marker
13+
- id: check-merge-conflict
14+
- id: debug-statements
15+
- id: detect-private-key
16+
exclude: tests/data/.*
17+
- id: check-builtin-literals
18+
- id: check-case-conflict
19+
- id: check-docstring-first
20+
- id: check-executables-have-shebangs
21+
- id: check-json
22+
exclude: '.devcontainer/.*'
23+
- id: pretty-format-json
24+
exclude: '.devcontainer/.*'
25+
args:
26+
- --indent
27+
- '4'
28+
- --autofix
29+
- --no-sort-keys
30+
- id: check-toml
31+
- id: fix-encoding-pragma
32+
args:
33+
- --remove
34+
- repo: https://github.com/psf/black
35+
rev: 6fdf8a4af28071ed1d079c01122b34c5d587207a # frozen: 24.2.0
36+
hooks:
37+
- id: black
38+
- repo: https://github.com/pycqa/isort
39+
rev: c235f5e450b4b84e58d114ed4c589cbf454175a3 # frozen: 5.13.2
40+
hooks:
41+
- id: isort
42+
- repo: https://github.com/pre-commit/pygrep-hooks
43+
rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 # frozen: v1.10.0
44+
hooks:
45+
- id: python-no-eval
46+
- id: python-no-log-warn
47+
- repo: https://github.com/asottile/pyupgrade
48+
rev: df17dfa3911b81b4a27190b0eea5b1debc7ffa0a # frozen: v3.15.1
49+
hooks:
50+
- id: pyupgrade
51+
args:
52+
- "--py38-plus"
53+
54+
- repo: local
55+
hooks:
56+
- id: mypy
57+
name: mypy
58+
entry: mypy
59+
language: system
60+
types: [python]
61+
- id: pylint
62+
name: pylint
63+
entry: pylint
64+
args:
65+
- '-s'
66+
- 'no'
67+
language: system
68+
types: [python]
69+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
70+
rev: 8d1b9cadaf854cb25bb0b0f5870e1cc66a083d6b # frozen: 0.2.3
71+
hooks:
72+
- id: yamlfmt
73+
args:
74+
- --mapping
75+
- '2'
76+
- --sequence
77+
- '2'
78+
- --offset
79+
- '0'
80+
- --width
81+
- '120'
82+
- -e
83+
- -p

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"github.vscode-pull-request-github"
4+
]
5+
}

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"."
4+
],
5+
"python.testing.unittestEnabled": false,
6+
"python.testing.pytestEnabled": true,
7+
}

asyncirc/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
"""
55

66
__all__ = ("protocol", "server")
7+
8+
__version__ = '0.1.8'

pyproject.toml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "async-irc"
7+
dynamic = ["version"]
8+
description = "A simple asyncio.Protocol implementation designed for IRC"
9+
readme = "README.md"
10+
license = "MIT"
11+
requires-python = ">=3.8"
12+
authors = [
13+
{ name = "linuxdaemon", email = "[email protected]" },
14+
]
15+
keywords = [
16+
"async-irc",
17+
"asyncio",
18+
"asyncirc",
19+
"irc",
20+
"irc-framework",
21+
]
22+
classifiers = [
23+
"Development Status :: 3 - Alpha",
24+
"License :: OSI Approved :: MIT License",
25+
"Programming Language :: Python :: 3.8",
26+
]
27+
dependencies = [
28+
"py-irclib",
29+
]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/TotallyNotRobots/async-irc"
33+
34+
[tool.hatch.version]
35+
path = "asyncirc/__init__.py"
36+
37+
[tool.hatch.build.targets.sdist]
38+
include = [
39+
"/asyncirc",
40+
]
41+
42+
[tool.hatch.build.targets.wheel]
43+
packages = [
44+
"asyncirc",
45+
]
46+
47+
[tool.isort]
48+
line_length = 80
49+
multi_line_output = 3
50+
include_trailing_comma = true
51+
use_parentheses = true
52+
known_first_party = ["asyncirc", "tests"]
53+
float_to_top = true
54+
55+
[tool.black]
56+
line-length = 80
57+
target-version = ['py38']
58+
include = '\.pyi?$'
59+
exclude = '''
60+
(
61+
/(
62+
\.eggs # exclude a few common directories in the
63+
| \.git # root of the project
64+
| \.hg
65+
| \.mypy_cache
66+
| \.tox
67+
| \.venv
68+
| _build
69+
| buck-out
70+
| build
71+
| dist
72+
| venv
73+
)/
74+
)
75+
'''
76+
77+
[tool.pylint.main]
78+
analyse-fallback-blocks = true
79+
py-version = "3.8"
80+
81+
[tool.pylint.messages_control]
82+
disable = [
83+
]
84+
85+
enable = ["c-extension-no-member"]
86+
87+
[tool.pylint.typecheck]
88+
generated-members = "(requests\\.)?codes\\.[a-zA-Z0-9_]+"
89+
90+
[tool.mypy]
91+
namespace_packages = true
92+
python_version = "3.8"
93+
warn_unused_configs = true
94+
strict = false
95+
strict_optional = false
96+
ignore_missing_imports = true
97+
check_untyped_defs = true
98+
show_error_codes = true
99+
warn_unused_ignores = true
100+
warn_redundant_casts = true
101+
# strict_equality = true

0 commit comments

Comments
 (0)