Skip to main content

No project description provided

Project description

FineCode

Personalize and improve your development experience

FineCode is a tool runner and set of utilities for creating tools for software developers.

With FineCode you can:

  • make tool configuration in your project reusable and distributable(see Presets below)
  • improve integration of tools used in the project with IDE, especially in workspace setup
  • create your own tools with IDE integration out of the box, and IDE extensios as well

Getting started: example how to setup linting and formatting in your project

1.1 Install FineCode. We recommend using dependency groups (PEP-735) but not all package managers support them. We will show a recommended way with which you don't need package manager at all, only pip, but you can adapt it also for package manager used in your project.

1.1.1 Add dev_workspace dependency group to pyproject.toml:

[dependency-groups]
dev_workspace = ["finecode==0.3.*"]

1.1.2 Create dev_workspace venv: python -m venv .venvs/dev_workspace (Python Docs)

1.1.3 Activate this venv and install dependencies from dev_workspace group:

source .venvs/dev_workspace/bin/activate
python -m pip install --group="dev_workspace"

NOTE: pip install supports --group parameter since pip 25.1. Make sure you have new enough version, otherwise update it: python -m pip install --upgrade pip.

1.2 Using existing preset

1.2.1 Put fine_python_recommended dependency in dev_workspace dependency group:

[dependency-groups]
dev_workspace = ["finecode==0.3.*", "fine_python_recommended==0.3.*"]

For list of presets from FineCode authors see 'Presets' section below.

1.2.1 Run prepare-envs finecode command:

python -m finecode prepare-envs

1.3 Enable finecode and preset

[tool.finecode]
presets = [
    { source = "fine_python_recommended" }
]

1.4 That's it! Now you can lint and format your codebase by running lint and format actions(see 'IDE Integration' and 'CLI' sections for more details).

You can customize preset, create your own, implement own actions, action handlers and more. All these possibilities are explained in details below.

IDE Integration

VSCode

For integration with VSCode, install FineCode extension

CLI

  1. In virtualenv of your project you can use the following command:

python -m finecode run [run_options] <list_of_actions> [actions_payload]

Available run options:

  • --workdir="<path>" ... use provided directory as work directory
  • --project="<name>" ... run actions only in this project. Multiple projects can be selected by providing multiple --project="<name>" options
  • --concurrently ... run actions concurrently. Single projects are always handled concurrently, this option determines whether actions inside of single project are run concurrently or not
  • --trace ... activate trace(more detailed) logging

If no projects are provided via options, FineCode will interpret working directory as workspace root, find all projects in it and run provided actions in all projects, in which they exist.

If projects are provided, actions are expected to exist in all of them.

Actions payload: if actions require payload or you want to run them with payload other than configured, you can provide it after names of actions.

Examples:

  • python -m finecode run --concurrently lint check_formatting ... run lint and check_formatting actions concurrently in all projects in the workspace, root of which is in current working directory
  • python -m finecode --workdir="./finecode_extension_api" run lint check_formatting ... run lint and check_formatting sequentially in finecode_extension_api directory (project is there)
  • python -m finecode --project="fine_python_mypy" --project="fine_python_ruff" run lint ... run lint action in projects fine_python_mypy and fine_python_ruff. They should be discoverable from the working directory.
  1. You can dump project config with fully resolved configuration using following command:

python -m finecode dump-config [--trace] [--project="<project_name>"]

The result will be saved in <cwd>/finecode_config_dump/ directory.

Options:

  • --trace ... activate trace(more detailed) logging
  • --project ... by default config of project in current working directory is dumped. If current working directory contains multiple projects and you want to dump config of particular one, provide its name using this option

Extensions from FineCode authors

Presets

  • fine_python_recommended
  • fine_python_format
  • fine_python_lint

Actions and action handlers

Directory with actions

  • lint
    • Flake8
    • Ruff
    • Mypy
  • format
    • Black
    • isort

IDE

TODO: list all from LSP

Workspace with multiple subprojects

Reusing config

To reuse configuration in multiple subprojects, put it in a separate package in your workspace and add it as dev dependency in all subprojects in which you want to use it.

Design decision: there are multiple ways to achieve the same result:

  • separate package
    • configuration of subprojects doesn't depend on file structure of the workspace. Subproject can be moved in another place or even outside of workspace and this will not affect its configuration, only if path to package with common configuration was file path, it should be changed.
    • fully transparent: the full configuration is known in a subproject without searching workspace root and analyzing the workspace
  • hierarchical configuration
    • makes subprojects more dependent on workspace, in case of moving subproject, additional actions with configurations are needed to keep it the same
  • letting to define reusable part on workspace level and provide it automatically to all subprojects
    • not transparent, part of configuration is implicit
    • FineCode needs to check whether it was started in workspace or in subproject, go deeper in file tree and find workspace root to resolve all configurations

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

finecode-0.4.0a1.tar.gz (221.1 kB view details)

Uploaded Source

Built Distribution

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

finecode-0.4.0a1-py3-none-any.whl (80.7 kB view details)

Uploaded Python 3

File details

Details for the file finecode-0.4.0a1.tar.gz.

File metadata

  • Download URL: finecode-0.4.0a1.tar.gz
  • Upload date:
  • Size: 221.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for finecode-0.4.0a1.tar.gz
Algorithm Hash digest
SHA256 12d835b9a85df5ff61282c21b3975f5a19f7550e03ebf596f47a8ca8745a1794
MD5 5ff5e3b62da56b01a273f3e559cc62d5
BLAKE2b-256 88cbd13e39385905bc99984e9d810c18ac46298c33e527774ae15f8f3889509e

See more details on using hashes here.

File details

Details for the file finecode-0.4.0a1-py3-none-any.whl.

File metadata

  • Download URL: finecode-0.4.0a1-py3-none-any.whl
  • Upload date:
  • Size: 80.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for finecode-0.4.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d8ae59e6811998f15b4f326abbb3487b916ffb303d5901c40e3aab6e0253d42
MD5 fb62bd7a8fc16b89738a23d1235288cc
BLAKE2b-256 704ac2bdade0033b4176f05c71ec89ce812ad1cbf59c8b8e8d6ba4aee643ab9f

See more details on using hashes here.

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