Skip to content

Commit 263df30

Browse files
committed
rework boilerplate
1 parent ea9470c commit 263df30

File tree

14 files changed

+41
-80
lines changed

14 files changed

+41
-80
lines changed

.github/workflows/pyci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10-
strategy:
11-
matrix:
12-
# we want to test our package on several versions of Python
13-
python-version: [3.8, 3.9]
1410
steps:
1511
- uses: actions/checkout@v4
1612
- name: Set up Python

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__pycache__
33
dist/
44
*.pyc
5-
.venv/
5+
.venv
66
.coverage
77
coverage.xml
8-
.pytest_cache/
8+
*_cache/

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
install:
22
uv sync
33

4+
run:
5+
uv run hexlet-python-package
6+
47
test:
58
uv run pytest
69

hexlet_python_package/half.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def half(num):
2+
return num / 2

hexlet_python_package/scripts/__init__.py

Whitespace-only changes.

hexlet_python_package/scripts/hexlet_python_package.py

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import sys
2+
3+
from hexlet_python_package.half import half
4+
5+
6+
def main():
7+
print(half(float(sys.argv[-1])))
8+
9+
10+
if __name__ == "__main__":
11+
main()

hexlet_python_package/user.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ dev-dependencies = [
1616
]
1717

1818
[project.scripts]
19-
hexlet-python-package = "hexlet_python_package.scripts.hexlet_python_package:main"
19+
hexlet-python-package = "hexlet_python_package.scripts.main:main"
20+
21+
[build-system]
22+
requires = ["hatchling"]
23+
build-backend = "hatchling.build"
24+
25+
[tool.hatch.build.targets.wheel]
26+
packages = ["hexlet_python_package"]

ruff.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
line-length = 80
2+
3+
[lint.per-file-ignores]
4+
# init modules can contain the local imports, logic, unused imports
5+
"__init__.py" = ["F401"]
6+
7+
[lint]
8+
preview = true
9+
select = ["E", "F", "I"]

0 commit comments

Comments
 (0)