Skip to content

Commit

Permalink
Merge pull request #31 from Hexlet/fix-for-python-uv
Browse files Browse the repository at this point in the history
Fix for python uv
  • Loading branch information
fey authored Dec 13, 2024
2 parents 77ee261 + 3af2be3 commit 7d7719e
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 34 deletions.
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

0 comments on commit 7d7719e

Please sign in to comment.