Skip to content

Commit c9937f2

Browse files
chore: dependencies updated, pillow fixed
1 parent 06451cb commit c9937f2

File tree

18 files changed

+242
-225
lines changed

18 files changed

+242
-225
lines changed

.github/workflows/lint.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
1-
name: Lint
1+
name: Lint and test
22

3-
on: [push, pull_request]
3+
on: [push]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-latest
7+
runs-on: ${{matrix.os}}
8+
strategy:
9+
matrix:
10+
python: ["3.11", "3.12"]
11+
os: ["ubuntu-latest", "windows-latest"]
812

913
steps:
10-
- uses: actions/checkout@v3
11-
- name: Set up Python 3.11
14+
- uses: actions/checkout@v4
15+
- name: Set up Python ${{matrix.python}}
1216
uses: actions/setup-python@v4
1317
with:
14-
python-version: "3.11"
18+
python-version: ${{matrix.python}}
1519

16-
- name: Install requirements
20+
- name: Install poetry
1721
run: |
18-
pip install flake8 pyright
19-
pip install -r requirements.txt
22+
pip install pipx
23+
pipx install poetry
2024
21-
- name: Linting code by flake8
25+
- name: Install dependencies
2226
run: |
23-
flake8 --show-source --statistics
27+
poetry install
28+
29+
- name: Linting code by ruff
30+
run: |
31+
poetry run ruff check .
2432
2533
- name: Check types by pyright
2634
run: |
27-
pyright
35+
poetry run pyright .
36+
37+
- name: Run unit-tests
38+
run: poetry run python -m unittest

README.md

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,34 @@ Supercell\`s games.
1515
### How to install and use
1616

1717
- On Windows:
18-
- Download Python 3.7 or newer version
18+
- Download Python 3.10 or newer version
1919
from [official page](https://www.python.org/downloads/);
2020
- Install Python. While Installing, enable such parameters as "Add Python to
21-
PATH", "Install pip", "Install py launcher", "Associate files with Python" and "
22-
Add Python to environment variables";
21+
PATH", "Install pip", "Install py launcher", "Associate files with Python" and "Add Python to environment variables";
2322
- Download XCoder from
2423
the [releases page](https://github.com/Vorono4ka/XCoder/releases) and extract it;
2524
- Locate the extracted directory and install required modules:
26-
```pip install -r requirements.txt```;
25+
```cmd
26+
poetry install
27+
```
2728
- Execute "main.py" file.
2829
2930
- On Linux:
3031
- Open Terminal and install Python by executing following command:
31-
```sudo apt-get update && sudo apt-get install python3 python3-pip```;
32+
```sudo apt-get update && sudo apt-get install python3 python3-poetry```;
3233
- Download XCoder from
3334
the [releases page](https://github.com/Vorono4ka/XCoder/releases) and extract it;
3435
- Locate the extracted directory and install required modules by executing following
3536
command:
36-
```sudo pip3 install -r requirements.txt```;
37+
```sh
38+
poetry install
39+
```
3740
- Execute "main.py" file.
3841
39-
- On Android:
40-
- Download and install PyDroid app
41-
from [Google Play](https://play.google.com/store/apps/details?id=ru.iiec.pydroid3);
42-
- Open PyDroid and wait until Python installs;
43-
- Download XCoder from
44-
the [releases page](https://github.com/Vorono4ka/XCoder/releases) and extract it;
45-
- Install loguru using pip;
46-
- In PyDroid open and execute "main.py" file.
47-
4842
### Testing
4943
50-
The project supports unit-testing using the unittest module. To run tests by yourself, you can use the command:
51-
52-
```cmd
53-
python -m unittest
54-
```
55-
56-
or
57-
58-
```sh
59-
python3 -m unittest
60-
```
61-
62-
or using the poetry
44+
The project supports unit-testing using the unittest module. To run tests by yourself,
45+
use the command:
6346
6447
```sh
6548
poetry run python -m unittest

poetry.lock

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

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ readme = "README.md"
77

88
[tool.poetry.dependencies]
99
python = "^3.11"
10-
sc-compression = "^0.6.1"
11-
colorama = "^0.4.6"
10+
sc-compression = "0.6.5"
11+
colorama = "0.4.6"
1212
pylzham = "^0.1.3"
1313
zstandard = "^0.23.0"
14-
pillow = "^10.4.0"
15-
loguru = "^0.7.2"
14+
pillow = "11.2.0"
15+
loguru = "0.7.3"
1616

1717

1818
[tool.poetry.group.dev.dependencies]
1919
pyright = "^1.1.376"
2020
black = "^24.8.0"
2121
pre-commit = "^3.8.0"
22+
ruff = "^0.11.2"
2223

2324
[build-system]
2425
requires = ["poetry-core"]

requirements.txt

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

system/exceptions/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from system.exceptions.tool_not_found import ToolNotFoundException
2+
3+
__all__ = ["ToolNotFoundException"]

system/languages/en-EU.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
"other_features_label": "OTHER",
4444
"check_update": "Check for updates",
45-
"check_for_outdated": "Check for outdated packages",
4645
"reinit": "Repeat init",
4746
"change_language": "Select another language",
4847
"clear_directories": "Clear workspace dirs",
@@ -64,7 +63,6 @@
6463
"join_pic": "Joining picture...",
6564
"png_save": "Saving to png...",
6665
"saved": "Saving completed!",
67-
"xcod_not_found": "File '%s.xcod' doesn't exist!",
6866
"illegal_size": "Illegal image size! Expected %sx%s but we got %sx%s",
6967
"resize_qu": "Would you like to resize an image?",
7068
"resizing": "Resizing...",
@@ -74,7 +72,8 @@
7472
"compression_error": "Compression failed",
7573
"compression_done": "Compression done!",
7674
"dir_empty": "Dir '%s' is empty!",
77-
"not_found": "File '%s' not found!",
75+
"texture_not_found": "Texture file for '%s' not found!",
76+
"file_not_found": "File '%s' not found!",
7877
"cut_sprites_process": "Cutting sprites... (%d/%d)",
7978
"place_sprites_process": "Placing sprites... (%d/%d)",
8079
"not_implemented": "This feature will be added in future updates.\nYou can follow XCoder updates here: https://github.com/Vorono4ka/XCoder",

system/languages/ru-RU.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
"other_features_label": "ПРОЧЕЕ",
4444
"check_update": "Проверить обновления",
45-
"check_for_outdated": "Проверка устаревших модулей",
4645
"reinit": "Повторная инициализация",
4746
"change_language": "Выбрать другой язык",
4847
"clear_directories": "Очистить рабочие папки",
@@ -64,7 +63,6 @@
6463
"join_pic": "Соединяем картинку...",
6564
"png_save": "Сохраняем в png...",
6665
"saved": "Сохранение прошло успешно!",
67-
"xcod_not_found": "Файл '%s.xcod' не обнаружен!",
6866
"illegal_size": "Размер картинки не совпадает с оригиналом! Ожидалось %sx%s, но мы получили %sx%s",
6967
"resize_qu": "Хотите изменить размер?",
7068
"resizing": "Изменяем размер...",
@@ -74,7 +72,8 @@
7472
"compression_error": "Сжатие не удалось",
7573
"compression_done": "Сжатие прошло успешно!",
7674
"dir_empty": "Папка '%s' пуста!",
77-
"not_found": "Файл '%s' не найден!",
75+
"texture_not_found": "Текстуры для '%s' не найдена!",
76+
"file_not_found": "Файл '%s' не найден!",
7877
"cut_sprites_process": "Вырезаем спрайты... (%d/%d)",
7978
"place_sprites_process": "Ставим спрайты на место... (%d/%d)",
8079
"not_implemented": "Данная возможность будет добавлена в будущих обновлениях.\nЗа обновлениями XCoder вы можете следить здесь: https://github.com/Vorono4ka/XCoder",

system/languages/ua-UA.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
"other_features_label": "ІНШЕ",
4444
"check_update": "Шукати оновлення",
45-
"check_for_outdated": "Шукати застарілі пакети",
4645
"reinit": "Повторити налаштування",
4746
"change_language": "Вибрати іншу мову",
4847
"clear_directories": "Очистити робочі папки",
@@ -64,7 +63,6 @@
6463
"join_pic": "З'єднуємо зоображення...",
6564
"png_save": "Зберігаємо PNG...",
6665
"saved": "Збереження Виконано!",
67-
"xcod_not_found": "Файл '%s.xcod' не існує!",
6866
"illegal_size": "Неможливий розмір картинки! Очікували %sx%s але отримали %sx%s",
6967
"resize_qu": "Ти хочеш змінити розмір картинки?",
7068
"resizing": "змінюємо розмір...",
@@ -74,7 +72,8 @@
7472
"compression_error": "Запаковування не вдалося",
7573
"compression_done": "Запаковування виконане!",
7674
"dir_empty": "Папка '%s' порожня!",
77-
"not_found": "Файл '%s' не знайдено!",
75+
"texture_not_found": "Текстури для '%s' не знайдено!",
76+
"file_not_found": "Файл '%s' не знайдено!",
7877
"cut_sprites_process": "Обрізаємо спрайти... (%d/%d)",
7978
"place_sprites_process": "Вставляємо спрайти... (%d/%d)",
8079
"not_implemented": "Ця функція буде додана у наступних оновленнях.\nТи можеш сладкувати за оновленнями тут: https://github.com/Vorono4ka/XCoder",

system/lib/features/initialization.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from loguru import logger
44

5-
from system import clear, run
5+
from system import clear
66
from system.lib.config import config
77
from system.lib.features.directories import create_directories
8-
from system.lib.features.update.check import get_pip_info, get_tags
8+
from system.lib.features.update.check import get_tags
99
from system.localization import locale
1010

1111

@@ -17,18 +17,6 @@ def initialize(first_init=False):
1717
logger.info(locale.detected_os % platform.system())
1818
logger.info(locale.installing)
1919

20-
required_packages = [
21-
pkg.rstrip("\n").lower() for pkg in open("requirements.txt").readlines()
22-
]
23-
installed_packages = [pkg[0].lower() for pkg in get_pip_info()]
24-
for package in required_packages:
25-
if package in installed_packages:
26-
continue
27-
28-
if run(f"pip3 install {package}") == 0:
29-
logger.info(locale.installed % package)
30-
else:
31-
logger.info(locale.not_installed % package)
3220
logger.info(locale.crt_workspace)
3321
create_directories()
3422
logger.info(locale.verifying)

0 commit comments

Comments
 (0)