GithubHelp home page GithubHelp logo

pdm-config's Introduction

pdm-config

Pre-Commit Tests

This project provides a minimal example for setting up Python packages in 2023 with modern tooling. Its main purpose is reading information from cofiguration files in a structured, easily extendable and elegant fashion.

Tools

Package Manager

As the repository name suggests, this project uses pdm as package manager. pdm handles not only the installation of dependencies, but also the creation of virtual environments, execution of custom scripts similar to npm, and further serves as a build backend. Thus, it works as a modern alternative to poetry and replaces the traditional package building process based on setuptools.

Further, pdm stores all package metadata in pyproject.toml according to PEP 621. There is no need for setup.py, setup.cfg or requirements.txt files!

Development Tools

  • black for formatting.
  • ruff for linting as an extremely fast and more complete substitute of flake8. ruff can also replace isort for sorting imports.
  • pytest for testing. Shared pytest fixtures are collected in tests/conftest.py.
  • mypy for static type checking.

Libraries

This project uses toml as configuration format in combination with the tomllib library which was added to the standard library in Python 3.11. Further, it makes heavy use of Python dataclasses for convenient and structured storage and access of configuration data.

Workflow

  • pre-commit for running all kinds of checks before committing and pushing to the remote repository.
  • pdm scripts for easy and consistent task execution similar to a Makefile.
  • GitHub Actions as continuous integration service.

Installation

The easiest way to use the pdm_config package is to clone the repository from GitHub and run

pip install .

If you want to contribute to development or extend the project according to your own needs, run the command

pip install -e .

to install the package in editable mode with all development dependencies.

Usage

The entry point for this project is the __main__.py file in the pdm_config package directory. It simply prints out the configuration data and can be executed via

# from `pdm_config` directory
python __main__.py

# from `pdm_config` directory
python -m pdm_config

# from any point of the project
pdm main   # or `pdm run main`

pdm-config's People

Contributors

joel-beck avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.