Skip to content

Commit

Permalink
Add Dockerfile, .gitignore, and update dependencies for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dxns-hub committed Nov 28, 2024
1 parent fa6cd98 commit b5cfaf1
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 1 deletion.
83 changes: 83 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual Environment
.env
.venv
env/
venv/
ENV/

# VS Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Testing
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
htmlcov/

# Jupyter Notebook
.ipynb_checkpoints

# Distribution
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
.coverage
coverage.xml
*.cover
.pytest_cache/

# Logs
*.log
local_settings.py
db.sqlite3

# Environment variables
.env
.env.local
.env.*.local

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
21 changes: 21 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use Python 3.10 slim as base
FROM python:3.10-slim

# Set working directory
WORKDIR /app

# Copy project files
COPY pyproject.toml .
COPY setup.cfg .
COPY src/ src/
COPY tests/ tests/
COPY README.md .

# Install project dependencies
RUN pip install --no-cache-dir -e ".[test]"

# Set Python path for tests
ENV PYTHONPATH=/app/src

# Default command to run tests
CMD ["pytest", "tests/", "-v", "--cov=quantum_enhanced_lwe"]
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ classifiers = [
dependencies = [
"numpy>=1.21.0",
"scipy>=1.7.0",
"qiskit>=0.44.0"
]

[project.optional-dependencies]
test = [
"pytest>=7.0.0",
"pytest-cov>=4.1.0"
]
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ description-file = README.md
[tool:pytest]
testpaths = tests
python_files = test_*.py
addopts = --cov=quantum_enhanced_lwe --cov-report=term-missing
addopts = --cov=quantum_enhanced_lwe
--cov-report=term-missing

[coverage:run]
source = quantum_enhanced_lwe
Expand Down
16 changes: 16 additions & 0 deletions src/quantum_enhanced_lwe/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/Scripts/python.exe",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestArgs": [
"tests"
],
"python.analysis.extraPaths": [
"${workspaceFolder}/src"
],
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"editor.formatOnSave": true,
"python.formatting.provider": "black"
}

0 comments on commit b5cfaf1

Please sign in to comment.