Spaces:
Sleeping
Sleeping
Twin
commited on
Commit
·
ad0998d
1
Parent(s):
4629b40
Fix dependencies - create Space-specific pyproject.toml
Browse files✅ Changes:
- Create minimal pyproject.toml with only required dependencies
- Include FastAPI, uvicorn, mistralai, httpx, etc.
- Remove old uv.lock (will be regenerated with correct deps)
- Use 'uv lock' in Dockerfile to generate fresh lock file
🎯 This ensures all web framework dependencies are included
- Dockerfile +4 -4
- pyproject.toml +22 -103
- uv.lock +0 -0
Dockerfile
CHANGED
|
@@ -17,11 +17,11 @@ ENV HOME=/home/user \
|
|
| 17 |
# Set working directory
|
| 18 |
WORKDIR $HOME/app
|
| 19 |
|
| 20 |
-
# Copy
|
| 21 |
-
COPY --chown=user
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
RUN uv sync --
|
| 25 |
|
| 26 |
# Copy source code and application files
|
| 27 |
COPY --chown=user src/ src/
|
|
|
|
| 17 |
# Set working directory
|
| 18 |
WORKDIR $HOME/app
|
| 19 |
|
| 20 |
+
# Copy pyproject.toml and generate lock file
|
| 21 |
+
COPY --chown=user pyproject.toml ./
|
| 22 |
|
| 23 |
+
# Generate lock file and install dependencies
|
| 24 |
+
RUN uv lock && uv sync --no-install-project
|
| 25 |
|
| 26 |
# Copy source code and application files
|
| 27 |
COPY --chown=user src/ src/
|
pyproject.toml
CHANGED
|
@@ -3,112 +3,31 @@ requires = ["setuptools>=61.0", "wheel"]
|
|
| 3 |
build-backend = "setuptools.build_meta"
|
| 4 |
|
| 5 |
[project]
|
| 6 |
-
name = "pii-masking"
|
| 7 |
version = "0.1.0"
|
| 8 |
-
description = "PII Masking
|
| 9 |
-
authors = [
|
| 10 |
-
{name = "Applied AI Engineer Candidate", email = "[email protected]"}
|
| 11 |
-
]
|
| 12 |
-
readme = "README.md"
|
| 13 |
requires-python = ">=3.9"
|
| 14 |
-
classifiers = [
|
| 15 |
-
"Development Status :: 3 - Alpha",
|
| 16 |
-
"Intended Audience :: Developers",
|
| 17 |
-
"License :: OSI Approved :: MIT License",
|
| 18 |
-
"Programming Language :: Python :: 3",
|
| 19 |
-
|
| 20 |
-
"Programming Language :: Python :: 3.9",
|
| 21 |
-
"Programming Language :: Python :: 3.10",
|
| 22 |
-
"Programming Language :: Python :: 3.11",
|
| 23 |
-
]
|
| 24 |
dependencies = [
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
"python-dotenv>=1.0.0",
|
| 27 |
-
"
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
"
|
| 31 |
-
"scikit-learn>=1.1.0",
|
| 32 |
-
"transformers>=4.20.0",
|
| 33 |
-
"torch>=1.12.0",
|
| 34 |
-
"datasets>=2.0.0",
|
| 35 |
-
"seqeval>=1.2.0",
|
| 36 |
-
"tqdm>=4.64.0",
|
| 37 |
-
"pydantic>=2.0.0",
|
| 38 |
-
"click>=8.0.0",
|
| 39 |
-
"mistral-common[sentencepiece]>=1.8.4",
|
| 40 |
-
"tiktoken>=0.11.0",
|
| 41 |
]
|
| 42 |
|
| 43 |
-
[
|
| 44 |
-
dev = [
|
| 45 |
-
"pytest>=7.0.0",
|
| 46 |
-
"pytest-cov>=4.0.0",
|
| 47 |
-
"black>=22.0.0",
|
| 48 |
-
"isort>=5.10.0",
|
| 49 |
-
"flake8>=5.0.0",
|
| 50 |
-
"mypy>=1.0.0",
|
| 51 |
-
"pre-commit>=2.20.0",
|
| 52 |
-
]
|
| 53 |
-
|
| 54 |
-
[project.urls]
|
| 55 |
-
Homepage = "https://github.com/candidate/pii-masking"
|
| 56 |
-
Repository = "https://github.com/candidate/pii-masking"
|
| 57 |
-
|
| 58 |
-
[project.scripts]
|
| 59 |
-
pii-evaluate = "pii_masking.cli:main"
|
| 60 |
-
|
| 61 |
-
[tool.setuptools.packages.find]
|
| 62 |
-
where = ["src"]
|
| 63 |
-
|
| 64 |
-
[tool.black]
|
| 65 |
-
line-length = 88
|
| 66 |
-
target-version = ['py38']
|
| 67 |
-
include = '\.pyi?$'
|
| 68 |
-
extend-exclude = '''
|
| 69 |
-
/(
|
| 70 |
-
# directories
|
| 71 |
-
\.eggs
|
| 72 |
-
| \.git
|
| 73 |
-
| \.hg
|
| 74 |
-
| \.mypy_cache
|
| 75 |
-
| \.tox
|
| 76 |
-
| \.venv
|
| 77 |
-
| build
|
| 78 |
-
| dist
|
| 79 |
-
)/
|
| 80 |
-
'''
|
| 81 |
-
|
| 82 |
-
[tool.isort]
|
| 83 |
-
profile = "black"
|
| 84 |
-
multi_line_output = 3
|
| 85 |
-
line_length = 88
|
| 86 |
-
known_first_party = ["pii_masking"]
|
| 87 |
-
|
| 88 |
-
[tool.mypy]
|
| 89 |
-
python_version = "3.8"
|
| 90 |
-
warn_return_any = true
|
| 91 |
-
warn_unused_configs = true
|
| 92 |
-
disallow_untyped_defs = true
|
| 93 |
-
disallow_incomplete_defs = true
|
| 94 |
-
check_untyped_defs = true
|
| 95 |
-
disallow_untyped_decorators = true
|
| 96 |
-
no_implicit_optional = true
|
| 97 |
-
warn_redundant_casts = true
|
| 98 |
-
warn_unused_ignores = true
|
| 99 |
-
warn_no_return = true
|
| 100 |
-
warn_unreachable = true
|
| 101 |
-
strict_equality = true
|
| 102 |
-
|
| 103 |
-
[tool.pytest.ini_options]
|
| 104 |
-
testpaths = ["tests"]
|
| 105 |
-
python_files = ["test_*.py"]
|
| 106 |
-
python_classes = ["Test*"]
|
| 107 |
-
python_functions = ["test_*"]
|
| 108 |
-
addopts = [
|
| 109 |
-
"--cov=src/pii_masking",
|
| 110 |
-
"--cov-report=term-missing",
|
| 111 |
-
"--cov-report=html",
|
| 112 |
-
"--strict-markers",
|
| 113 |
-
"--disable-warnings",
|
| 114 |
-
]
|
|
|
|
| 3 |
build-backend = "setuptools.build_meta"
|
| 4 |
|
| 5 |
[project]
|
| 6 |
+
name = "pii-masking-space"
|
| 7 |
version = "0.1.0"
|
| 8 |
+
description = "PII Masking Demo Space"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
requires-python = ">=3.9"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
dependencies = [
|
| 11 |
+
# FastAPI and web server
|
| 12 |
+
"fastapi>=0.104.0",
|
| 13 |
+
"uvicorn[standard]>=0.24.0",
|
| 14 |
+
"pydantic>=2.5.0",
|
| 15 |
+
"python-multipart>=0.0.6",
|
| 16 |
+
|
| 17 |
+
# HTTP Client for API calls
|
| 18 |
+
"httpx>=0.27.0",
|
| 19 |
+
"aiohttp>=3.9.0",
|
| 20 |
+
|
| 21 |
+
# Mistral AI client
|
| 22 |
+
"mistralai>=1.0.0",
|
| 23 |
+
|
| 24 |
+
# Utilities
|
| 25 |
"python-dotenv>=1.0.0",
|
| 26 |
+
"loguru>=0.7.0",
|
| 27 |
+
|
| 28 |
+
# Basic data processing
|
| 29 |
+
"numpy>=1.24.0",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
]
|
| 31 |
|
| 32 |
+
[tool.uv]
|
| 33 |
+
dev-dependencies = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uv.lock
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|