Skip to main content

Cross-platform Python installation support scripts for DTU

Project description

pis-utils

Cross-platform Python Installation Support utilities for DTU

A PyPI-ready package providing command-line tools for installing and configuring development tools at DTU (Technical University of Denmark).

Features

  • ๐Ÿ Miniforge3 Installer - Automated conda/mamba installation from philipnickel/miniforge
  • ๐Ÿš€ VS Code Installer - Automated installation with extensions and settings
  • ๐Ÿ”ง Cross-platform - Works on Windows, macOS (Intel & Apple Silicon), and Linux
  • ๐Ÿ“ฆ Easy to use - Simple CLI commands with beautiful progress indicators
  • ๐Ÿงช Well tested - Comprehensive test suite with 40 tests
  • ๐Ÿ› ๏ธ Clean Uninstall - Complete removal of tools and user data

Installation

For End Users

From GitHub (recommended for now):

# Install VS Code with extensions and settings
uvx --from git+https://github.com/PN-CourseWork/miniforge-DTU-PIS pis-utils install vscode

Future: From PyPI (once published):

uvx pis-utils install vscode

For Development

# Clone the repository
git clone https://github.com/PN-CourseWork/miniforge-DTU-PIS.git
cd PIS-Scripts-Utilities

# Install in editable mode with development dependencies
uv sync --all-extras

# Verify installation
pis-utils --version

Usage

Install Miniforge3 (Conda)

# Install latest stable release
pis-utils install conda

# Install development (prerelease) version
pis-utils install conda --prerelease

This will:

  1. Download the appropriate Miniforge3 installer for your platform
  2. Run the installer in batch mode with conda initialization
  3. Set up conda/mamba for Python package management

Note: Restart your terminal after installation to activate conda.

Install VS Code

# Install VS Code with extensions and settings
pis-utils install vscode

This will:

  1. Download and install VS Code for your platform
  2. Install Python development extensions (Python, Jupyter)
  3. Apply settings to disable AI features and the Python Environments extension
  4. Configure VS Code with optimal defaults for Python development

Note: The Python extension automatically installs Pylance and Python Debugger. The Python Environments extension is also installed but disabled via the python.useEnvironmentsExtension setting to maintain the classic environment selection experience.

Uninstall Tools

# Uninstall conda/Miniforge3
pis-utils uninstall conda

# Uninstall VS Code
pis-utils uninstall vscode

Available Commands

# Show help
pis-utils --help

# Show version
pis-utils --version

# Install commands
pis-utils install --help
pis-utils install conda
pis-utils install vscode

# Uninstall commands
pis-utils uninstall --help
pis-utils uninstall conda
pis-utils uninstall vscode

Development

Project Structure

PIS-Scripts-Utilities/
โ”œโ”€โ”€ src/pis_utils/          # Main package
โ”‚   โ”œโ”€โ”€ cli.py              # CLI entry point
โ”‚   โ”œโ”€โ”€ config.toml         # Configuration (URLs, settings, extensions)
โ”‚   โ”œโ”€โ”€ core/               # Core utilities
โ”‚   โ”‚   โ”œโ”€โ”€ console.py      # Rich console instance
โ”‚   โ”‚   โ”œโ”€โ”€ platform.py     # Platform/architecture detection
โ”‚   โ”‚   โ””โ”€โ”€ download.py     # HTTP download utilities
โ”‚   โ””โ”€โ”€ commands/           # Command implementations
โ”‚       โ”œโ”€โ”€ install.py      # Install command group
โ”‚       โ”œโ”€โ”€ uninstall.py    # Uninstall command group
โ”‚       โ”œโ”€โ”€ conda.py        # Miniforge3 installer
โ”‚       โ””โ”€โ”€ vscode.py       # VS Code installer
โ”œโ”€โ”€ tests/                  # Test suite
โ”‚   โ”œโ”€โ”€ commands/           # Command tests
โ”‚   โ”œโ”€โ”€ core/               # Utility tests
โ”‚   โ”œโ”€โ”€ conftest.py         # Pytest fixtures
โ”‚   โ””โ”€โ”€ test_cli.py         # CLI tests
โ”œโ”€โ”€ pyproject.toml          # Package metadata
โ””โ”€โ”€ README.md

Running Tests

# Run all tests
pytest

# Run specific test file
pytest tests/commands/test_vscode.py

# Run specific test function
pytest tests/commands/test_vscode.py::test_get_download_url_windows

# Run with coverage
pytest --cov --cov-report=html

# View coverage report
open htmlcov/index.html  # macOS

Code Quality

# Format code
ruff format .

# Lint code
ruff check .

# Auto-fix linting issues
ruff check --fix .

# Type check
mypy src/

Building and Testing Locally

# Build the package
uv build

# Verify build outputs
ls dist/
# Should see: pis_utils-0.1.0-py3-none-any.whl and pis_utils-0.1.0.tar.gz

# Test installation from wheel
uv pip install dist/pis_utils-0.1.0-py3-none-any.whl --force-reinstall

# Test the CLI
pis-utils --version
pis-utils install vscode

# Test via uvx (simulates end-user experience)
uvx --from . pis-utils install vscode

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting (pytest && ruff check .)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

MIT License - see LICENSE for details.

Maintainer

Philip Korsager Nickel - philipnickel@outlook.dk


Related Projects

This package is part of the DTU Miniforge3 ecosystem:

  • DTU Miniforge3 - Customized Miniforge3 installers for DTU courses
  • pis-utils (this repo) - Python installation support utilities

Legacy Installation Methods (from main DTU Miniforge3 repo)

For Miniforge3 and legacy VS Code installation scripts, see the main DTU Miniforge3 repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pis_utils-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pis_utils-0.1.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file pis_utils-0.1.1.tar.gz.

File metadata

  • Download URL: pis_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pis_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cea09fbb086d041b98bf29529d70069ab8bc509de6c8541fe88f532e227091a4
MD5 3a01aeb4e89e068b2bc942dfe3655810
BLAKE2b-256 07c08ff8af783dc273af1c6d3c034b67659255bede09d7e6ade050742e24d3ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for pis_utils-0.1.1.tar.gz:

Publisher: publish.yml on philipnickel/PIS-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pis_utils-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pis_utils-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pis_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c59fa6fabd110609a9dfe6f1dc02a54199aac2781a9d34c57b8078aee8a4b1a
MD5 7e7cae945438af6ea27865d2e7445463
BLAKE2b-256 4c9f20b8ebaf5b3b60cbc591a438aaf9d8f5678039b367262e909725b8f4b026

See more details on using hashes here.

Provenance

The following attestation bundles were made for pis_utils-0.1.1-py3-none-any.whl:

Publisher: publish.yml on philipnickel/PIS-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page