Skip to content

Commit 724fd1b

Browse files
author
bakhee
committed
feat: update ci
1 parent c04ea82 commit 724fd1b

File tree

5 files changed

+58
-12
lines changed

5 files changed

+58
-12
lines changed

.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Python version
2+
PYTHON_VER_MIN_MAJOR=3
3+
PYTHON_VER_MIN_MINOR=9
4+
5+
# Input data
6+
INPUT_DAY_HOURS_START=9
7+
INPUT_DAY_HOURS_END=19
8+
INPUT_HOUR_CONDITIONS_SCORE="{'clear': 1, 'partly-cloudy': 1, 'cloudy': 1, 'overcast': 1}"
9+
INPUT_LINKS_PATH="src/core/cities.json"
10+
INPUT_COND_WEIGHT=0.5
11+
INPUT_TEMP_WEIGHT=0.5
12+
INPUT_TOP_LOCATIONS_COUNT=5
13+
14+
# Output data
15+
OUTPUT_PATH="output.json"

.github/workflows/app-testing.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-and-test
1+
name: CI
22

33
on:
44
push:
@@ -49,7 +49,7 @@ jobs:
4949

5050
strategy:
5151
matrix:
52-
python-version: ['3.10', '3.11', '3.12', '3.13']
52+
python-version: ['3.12', '3.13']
5353

5454
steps:
5555
# 1. Checkout the code from the repository
@@ -62,6 +62,7 @@ jobs:
6262
with:
6363
python-version: ${{ matrix.python-version }}
6464

65+
6566
# 3. Install dependencies
6667
- name: Install Dependencies
6768
run: |
@@ -86,4 +87,4 @@ jobs:
8687
# 7. Run Pytest
8788
- name: Run Pytest
8889
run: |
89-
echo "${{ needs.check.outputs.changed_files }}" | xargs pytest --maxfail=10 --disable-warnings --tb=short
90+
pytest --maxfail=10 --disable-warnings --tb=short

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ cython_debug/
111111
mypy_cache/
112112
ruff_cache/
113113

114-
output.json # for analyzer
114+
output.json

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ env:
66
cp "$$file" "$$(dirname $$file)/.env"; \
77
done
88

9+
910
.PHONY: sync
1011
sync:
11-
@curl -LsSf https://astral.sh/uv/install.sh | sh
12-
@uv venv
1312
@uv sync --frozen --all-extras
1413

14+
.PHONY: setup
15+
setup:
16+
@curl -LsSf https://astral.sh/uv/install.sh | sh
17+
1518
.PHONY: upd_hooks
1619
upd_hooks:
1720
@pre-commit clean
@@ -21,3 +24,14 @@ upd_hooks:
2124
check:
2225
@git add .
2326
@pre-commit run
27+
28+
.PHONY: up
29+
up: env setup sync
30+
31+
.PHONY: run
32+
run: sync env
33+
@python -m src.main
34+
35+
.PHONY: test
36+
test:
37+
pytest

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Weather Data Analysis
2-
[![Linting and Testing](https://github.com/agredyaev/async-python-sprint-1/actions/workflows/app-testing.yml/badge.svg)](https://github.com/agredyaev/async-python-sprint-1/actions/workflows/app-testing.yml)
32
![Python](https://img.shields.io/badge/python-3.13-blue)
4-
![Pydantic](https://img.shields.io/badge/pydantic-red)
5-
![HTTPX](https://img.shields.io/badge/httpx-green)
6-
![UV](https://img.shields.io/badge/uv-lemon)
7-
![Ruff](https://img.shields.io/badge/ruff-linter-orange)
8-
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
3+
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
4+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
5+
[![Actions status](https://github.com/agredyaev/async-python-sprint-1/actions/workflows/app-testing.yml/badge.svg)](https://github.com/agredyaev/async-python-sprint-1/actions)
6+
![Pydantic](https://img.shields.io/badge/Pydantic-red?logo=pydantic&logoColor=white)
7+
![HTTPX](https://img.shields.io/badge/HTTPX-green?logo=httpx&logoColor=white)
8+
![Polars](https://img.shields.io/badge/Polars-blue?logo=polars&logoColor=white)
9+
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
910

1011
## Project Overview
1112

@@ -16,3 +17,18 @@ This project analyzes weather conditions using data from the Yandex Weather API.
1617
- **ExtractTask**: Extracts and validates relevant weather data.
1718
- **TransformTask**: Processes and transforms raw weather data into structured formats.
1819
- **AnalyzeTask**: Analyzes transformed data to compute key metrics like weather scores.
20+
21+
## Deploy
22+
```bash
23+
# clone the repository
24+
git clone https://github.com/agredyaev/async-python-sprint-1.git
25+
cd async-python-sprint-1
26+
# setup the environment
27+
make setup
28+
# activate the virtual environment
29+
. ./.venv/bin/activate
30+
# run the app
31+
make run
32+
# run the tests
33+
make test
34+
```

0 commit comments

Comments
 (0)