Developer Environment Setup
Relevant source files
The following files were used as context for generating this wiki page:The DevSkyy project utilizes a modern, professional development environment centered around Python 3.11, Docker, and a comprehensive set of code quality tools. The setup is designed to ensure consistency, maintainability, and security across the platform, which is a luxury fashion AI platform with a multi-AI orchestration system.
This guide outlines the necessary steps and components for setting up a local development environment. It covers prerequisites, dependency management, environment configuration, and the development workflow, including testing and code quality checks. For more detailed information on dependency management strategies, refer to the Dependencies Management Guide.
Prerequisites
Before setting up the environment, ensure the following tools are installed on your system.
| Tool | Minimum Version | Purpose |
|---|---|---|
| Python | 3.11 | Primary programming language. |
| Git | N/A | Version control system. |
| Docker | 20.10+ | Containerization for services. |
| Docker Compose | 2.0+ | Managing multi-container Docker applications. |
Sources: CONTRIBUTING.md:12, DOCKER_MCP_DEPLOYMENT.md:21-22
Initial Setup Workflow
The following diagram illustrates the high-level steps for setting up a new development environment.
This diagram shows the standard flow from getting the code to running the application locally.
Sources: CONTRIBUTING.md:15-29, ENV_SETUP_GUIDE.md:4-12
1. Clone the Repository
First, clone the DevSkyy repository from GitHub to your local machine.
git clone https://github.com/The-Skyy-Rose-Collection-LLC/DevSkyy.git
cd DevSkyy
Sources: CONTRIBUTING.md:16-19
2. Install Dependencies
The project uses a combination of pyproject.toml for project metadata and a structured set of requirements.txt files for managing Python dependencies. For a development environment, you should install the dependencies listed in requirements-dev.txt, which includes all production and testing packages.
You can install dependencies using the provided Makefile command or pip.
Option A: Using Makefile (Recommended)
make dev-install
Sources: CONTRIBUTING.md:21-24
Option B: Using pip
pip install -r requirements-dev.txt
Sources: DEPENDENCIES.md:44
3. Configure Environment Variables
The application requires several environment variables for API keys and configuration. These are managed using a .env file.
- Copy the template:
cp .env.template .env - Edit the
.envfile and fill in the required values.
Sources: ENV_SETUP_GUIDE.md:4-6
The following table lists the minimum required variables for basic functionality.
| Variable | Description | How to Generate/Find |
|---|---|---|
SECRET_KEY | A secret key for signing sessions and tokens. | python -c "import secrets; print(secrets.token_urlsafe(32))" |
ANTHROPIC_API_KEY | API key for the Anthropic Claude model. | Get from the Anthropic Console. |
DATABASE_URL | The connection string for the database. | Defaults to sqlite:///./devskyy.db for local development. |
Sources: ENV_SETUP_GUIDE.md:14-31
4. Verify Setup
After installation, run the test suite to ensure everything is configured correctly.
make test
Sources: CONTRIBUTING.md:26-28
You can also use the verification scripts provided in the ENV_SETUP_GUIDE.md to test individual components like the .env loading, API key validity, and database connection.
Sources: ENV_SETUP_GUIDE.md:240-252
Dependency Management
The project maintains a strict and organized dependency management strategy to ensure reproducibility and security. Dependencies are split across multiple files, each serving a specific purpose.
Sources: DEPENDENCIES.md
Requirements File Structure
The diagram below shows the inheritance structure of the main requirements files.
This diagram illustrates that both development and test environments inherit the core production dependencies.
Sources: DEPENDENCIES.md:39-41, 55-57
The roles of the key files are summarized below:
| File | Purpose | Versioning Rule |
|---|---|---|
requirements.txt | Core production dependencies for full-featured deployment. | All packages pinned with ==. |
requirements-dev.txt | Development tools (linters, formatters, debuggers). Inherits from requirements.txt. | All packages pinned with ==. |
requirements-test.txt | Testing framework and utilities. Inherits from requirements.txt. | All packages pinned with ==. |
requirements-production.txt | Lightweight production deployment, excluding heavy ML libraries. | All packages pinned with ==. |
Sources: DEPENDENCIES.md:10-70, REQUIREMENTS_REFACTOR_SUMMARY.md
Validation Scripts
To maintain dependency hygiene, the project includes validation scripts. The fast Python-based script is recommended for CI/CD and pre-commit hooks.
scripts/validate_requirements_fast.py: Fast validation of pinning, duplicates, and inheritance.scripts/validate_requirements.sh: Comprehensive validation includingpip install --dry-runand security scanning.
To run the fast validation:
python3 scripts/validate_requirements_fast.py
Sources: scripts/README.md:5-29, REQUIREMENTS_REFACTOR_SUMMARY.md:80-92
Code Quality and Tooling
The project enforces high code quality standards using modern tooling, configured primarily in pyproject.toml.
Sources: TRANSFORMERS_INTEGRATION_ANALYSIS.md:101-118, CONTRIBUTING.md:32-41
Linting and Formatting with Ruff
Ruff is used as the primary linter and formatter to ensure a consistent code style.
Key configuration from pyproject.toml:
[tool.ruff]
target-version = "py310"
line-length = 119
[tool.ruff.lint]
select = ["C", "E", "F", "I", "W", "RUF013", "PERF102"]
ignore = ["C901", "E501", "E741", "F402"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
Sources: TRANSFORMERS_INTEGRATION_ANALYSIS.md:43-51
Pre-commit Workflow
The repository is configured with pre-commit hooks to automate code quality checks before each commit.
The workflow is as follows:
This diagram shows the automated checks that run before a commit is finalized.
Sources: CONTRIBUTING.md:43-53
To run the pre-commit checks manually:
make pre-commit
Sources: CONTRIBUTING.md:44
Running the Application
Local Development Server
To start the FastAPI application locally with hot-reloading enabled:
Option A: Using Makefile
make run
Sources: CONTRIBUTING.md:29-31
Option B: Using Uvicorn
uvicorn main:app --reload
Sources: ENV_SETUP_GUIDE.md:255
Once running, the API documentation will be available at http://localhost:8000/docs.
Sources: DOCKER_MCP_DEPLOYMENT.md:83
Docker-Based Environment
For a more isolated and production-like environment, you can use Docker Compose to run all services, including the API, database, and cache.
-
Ensure your
.envfile is configured as described previously. -
Run the following command to build and start all services in the background:
docker-compose -f docker-compose.mcp.yml up -d
Sources: DOCKER_MCP_DEPLOYMENT.md:49-51
The Docker environment includes the following services:
This diagram shows the containerized services managed by Docker Compose for the MCP deployment.
Sources: DOCKER_MCP_DEPLOYMENT.md:9-15
Testing
The project uses pytest for testing. Tests are organized into categories using markers.
Running Tests
- Run all tests:
make test - Run unit tests only:
make test-unit - Run with coverage report:
make test-coverage
Sources: CONTRIBUTING.md:66-84
Test Categories
| Marker | Description |
|---|---|
@pytest.mark.unit | Unit tests for individual components. |
@pytest.mark.integration | Tests for interactions between components. |
@pytest.mark.api | Tests for API endpoints. |
@pytest.mark.security | Security-related tests. |
@pytest.mark.performance | Performance and load tests. |
@pytest.mark.slow | Long-running tests. |
Sources: CONTRIBUTING.md:59-64
Summary
The developer environment for DevSkyy is structured to support enterprise-grade development. It relies on explicit dependency pinning for reproducibility, modern tooling like Ruff for code quality, and a flexible setup that supports both local Python environments and a containerized stack with Docker. By following the outlined procedures for setup, dependency management, and testing, developers can contribute effectively while adhering to the project's high standards for quality and security.