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

Fix for python uv #31

Merged
merged 6 commits into from
Dec 13, 2024
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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
setup: install
setup:
docker pull hexletprojects/hexlet-project-source-ci
docker pull ubuntu:latest
make install

install:
npm install
Expand Down
44 changes: 19 additions & 25 deletions __fixtures__/package_files/correct/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
[tool.poetry]
[project]
name = "hexlet-code"
version = "0.1.0"
description = "Task manager"
authors = ["Hexlet team <[email protected]>"]
license = "MIT"
description = "Diff generator"
readme = "README.md"
homepage = "https://hexlet.io"

packages = [
{ include = "task_manager" },
requires-python = ">=3.12"
dependencies = [
"pathlib>=1.0.1",
"pyyaml>=6.0.2",
]

[tool.poetry.dependencies]
python = "^3.8"
Django = "^3.1.5"
python-dotenv = "^0.15.0"
gunicorn = "^20.0.4"
whitenoise = "^5.2.0"
django-bootstrap4 = "^2.3.1"
dj-database-url = "^0.5.0"
psycopg2-binary = "^2.8.6"
django-filter = "^2.4.0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry.dev-dependencies]
flake8 = "^3.8.4"
coverage = "^5.3.1"
[tool.hatch.build.targets.wheel]
packages = ["gendiff"]

[tool.poetry.scripts]
[dependency-groups]
dev = [
"pytest-cov>=6.0.0",
"pytest>=8.3.4",
"ruff>=0.8.3",
]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
[project.scripts]
gendiff = "gendiff.scripts.gendiff:main"
1 change: 0 additions & 1 deletion __fixtures__/project_source/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---

version: '3'
services:
app:
environment:
Expand Down
2 changes: 1 addition & 1 deletion dist/run-post-actions/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/run-post-actions/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/run-tests/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/run-tests/index.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/packageChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ const getData = (filepath) => parse(fs.readFileSync(filepath, 'utf-8'), getForma
const mapping = {
python: {
expectedPackageName: 'hexlet-code',
getPackageName: (codePath) => (
getData(getFullPath(codePath, 'pyproject.toml')).tool.poetry.name
),
getPackageName: (codePath) => {
const data = getData(getFullPath(codePath, 'pyproject.toml'));

return data.tool?.poetry?.name || data.project.name;
},
},
php: {
expectedPackageName: 'hexlet/code',
Expand Down
Loading