[TOC]
This guide covers setting up the development environment for RapidCopy.
| Component | Technology | Version |
|---|---|---|
| Backend | Python | 3.11+ |
| Frontend | Angular | 18.2 |
| Linting | Ruff | 0.4+ |
| Type Checking | Mypy | 1.10+ |
| Testing | Pytest | 8.0+ |
| Build | Docker, Make | - |
The recommended approach uses Docker containers for consistent environments.
- Docker & Docker Compose
- Git
- Make (optional, for build automation)
cd src/python
docker-compose -f ../docker/test/python/compose.yml run --rm tests pytest tests/unittests/ -qcd src/python
docker run --rm -v "$(pwd):/src" -w /src python:3.11-slim bash -c "pip install -q ruff && ruff check ."cd src/python
docker run --rm -v "$(pwd):/src" -w /src python:3.11-slim bash -c "pip install -q mypy types-requests && mypy ."Install Node.js (v18+ recommended)
curl -sSL https://install.python-poetry.org | python3 -docker buildx create --name mybuilder --driver docker-container
docker buildx use mybuilder
docker buildx inspect --bootstrapsudo apt-get install -y lftp python3-dev rar jqgit clone git@github.com:rccypher/RapidCopy.git
cd RapidCopycd src/python
poetry installcd src/angular
npm installcd src/e2e
npm installAll Python code must pass:
- Ruff - Linting (0 issues required)
- Mypy - Type checking (0 errors required)
- Pytest - All tests passing
cd src/python
mkdir -p build/config
poetry run python rapidcopy.py -c build/config --html ../angular/dist --scanfs build/scanfsmake scanfscd src/angular
npm start
# or
node_modules/@angular/cli/bin/ng serveDev server runs at http://localhost:4200
cd src/angular
npm run buildcd src/python
docker-compose -f ../docker/test/python/compose.yml run --rm tests pytest tests/unittests/ -vcd src/python
poetry run pytest tests/unittests/docker-compose -f ../docker/test/python/compose.yml run --rm tests pytest tests/unittests/ --cov=. --cov-report=htmlcd src/angular
npm test
# or headless
npm test -- --no-watch --browsers=ChromeHeadlessThe frontend was upgraded from Angular 4.x to Angular 18.2. Key changes:
When extending Immutable.js Record classes, do not declare class fields - they shadow the Record's getters.
Wrong (Immutable.js 4.x):
class ViewFile extends ViewFileRecord {
name: string; // This shadows the Record getter!
status: string;
}Correct:
class ViewFile extends ViewFileRecord {
constructor(props) { super(props); }
get name(): string {
return this.get("name");
}
get status(): string {
return this.get("status");
}
}- Replace
Observable.create()withnew Observable().pipe() - Use
import { of, throwError } from 'rxjs'instead ofObservable.of()/Observable.throw()
Test service classes that extend @Injectable() parent classes must also have @Injectable():
@Injectable()
class TestNotificationService extends NotificationService {
// ...
}# Check
ruff check .
# Auto-fix
ruff check . --fixConfiguration in pyproject.toml:
- Target: Python 3.11
- Line length: 120
- Rules: E, F, UP, B, SIM
mypy .Configuration in pyproject.toml:
- Python version: 3.11
- Strict optional handling
- Ignore missing imports (for third-party libs)
Before committing, ensure:
cd src/python
ruff check . # 0 issues
mypy . # 0 errors
pytest tests/unittests/ # All pass- Setup buildx:
docker buildx create --name mybuilder --driver docker-container
docker buildx use mybuilder
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx inspect --bootstrap- Start local registry:
docker run -d -p 5000:5000 --restart=always --name registry registry:2- Build:
make clean
make- Verify:
curl -X GET http://localhost:5000/v2/_catalog
docker buildx imagetools inspect localhost:5000/rapidcopy:latestmake STAGING_REGISTRY=myregistry:5000 STAGING_VERSION=0.0.1- Set project root to top-level
RapidCopydirectory - Configure interpreter to Poetry virtualenv
- Mark
src/pythonas 'Sources Root' - Add run configuration:
| Config | Value |
|---|---|
| Name | rapidcopy |
| Script path | rapidcopy.py |
| Parameters | -c ./build/config --html ../angular/dist --scanfs ./build/scanfs |
Recommended extensions:
- Python
- Pylance
- Ruff
- Docker
Settings (.vscode/settings.json):
{
"python.defaultInterpreterPath": "${workspaceFolder}/src/python/.venv/bin/python",
"python.analysis.typeCheckingMode": "basic",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}For testing, run a mock remote server:
make run-remote-serverConnection parameters:
| Option | Value |
|---|---|
| Remote Address | localhost |
| Remote Port | 1234 |
| Username | remoteuser |
| Password | remotepass |
| Remote Path | /home/remoteuser/files |
-
Update versions:
src/angular/package.jsonsrc/debian/changelog(useLANG=C date -Rfor date)src/e2e/tests/about.page.spec.ts- Copyright in
about-page.component.html
-
Tag the commit:
git tag vX.X.X
git push origin vX.X.XGitHub Actions will build and release automatically.
make clean && make
make docker-image-release RELEASE_VERSION=X.X.X RELEASE_REGISTRY=your-registrycd src/python
poetry run mkdocs servePreview at http://localhost:8000
poetry run mkdocs gh-deploy
git push github gh-pages