https://github.com/imperialcollegelondon/pip-tools-template

Template for a pip-tools-based python project without docs and license information

https://github.com/imperialcollegelondon/pip-tools-template

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 7 committers (28.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.5%) to scientific vocabulary

Keywords from Contributors

archival parallel decarbonisation distribution hydraulic-modelling transformers profiles generic projection energy-system-model
Last synced: 6 months ago · JSON representation

Repository

Template for a pip-tools-based python project without docs and license information

Basic Info
  • Host: GitHub
  • Owner: ImperialCollegeLondon
  • Language: Python
  • Default Branch: main
  • Size: 376 KB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Archived
Created about 3 years ago · Last pushed about 1 year ago
Metadata Files
Readme

README.md

pip-tools Template

Test and build

This is a minimal Python 3.12 application that uses pip-tools for packaging and dependency management. It also provides pre-commit hooks (for for ruff and mypy) and automated tests using pytest and GitHub Actions. Pre-commit hooks are automatically kept updated with a dedicated GitHub Action, this can be removed and replace with pre-commit.ci if using an public repo. It was developed by the Imperial College Research Computing Service.

pip-tools is chosen as a lightweight dependency manager that adheres to the latest standards using pyproject.toml.

Usage

To use this repository as a template for your own application:

  1. Click the green "Use this template" button above
  2. Name and create your repository
  3. Clone your new repository and make it your working directory
  4. Replace instances of myproject with your own application name. Edit:
    • pyproject.toml (also change the list of authors here)
    • tests/test_myproject.py
    • Rename myproject directory
  5. Create and activate a Virtual Environment:

bash python -m venv .venv source .venv/bin/activate # with Powershell on Windows: `.venv\Scripts\Activate.ps1`

  1. Install development requirements:

bash pip install -r dev-requirements.txt

  1. Install the git hooks:

bash pre-commit install

  1. Run the main app:

bash python -m myproject

  1. Run the tests:

bash pytest

Updating Dependencies

To add or remove dependencies:

  1. Edit the dependencies variables in the pyproject.toml file (aim to keep develpment tools separate from the project requirements).
  2. Update the requirements files:
    • pip-compile for requirements.txt - the project requirements.
    • pip-compile --extra dev -o dev-requirements.txt for dev-requirements.txt - the development requirements.
  3. Sync the files with your installation (install packages):
    • pip-sync dev-requirements.txt requirements.txt

To upgrade pinned versions, use the --upgrade flag with pip-compile.

Versions can be restricted from updating within the pyproject.toml using standard python package version specifiers, i.e. "black<23" or "pip-tools!=6.12.2"

Customising

All configuration can be customised to your preferences. The key places to make changes for this are:

  • The pyproject.toml file, where you can edit:
    • The build system (change from setuptools to other packaging tools like Hatch or flit).
    • The python version.
    • The project dependencies. Extra optional dependencies can be added by adding another list under [project.optional-dependencies] (i.e. doc = ["mkdocs"]).
    • The mypy and pytest configurations.
  • The .pre-commit-config.yaml for pre-commit settings.
  • The .github directory for all the CI configuration.
    • This repo uses pre-commit.ci to update pre-commit package versions and automatically merges those PRs with the auto-merge.yml workflow.
    • Note that pre-commit.ci is an external service and free for open source repos. For private repos uncomment the commented portion of the pre-commit_autoupdate.yml workflow.

Publishing

The GitHub workflow includes an action to publish on release. To run this action, uncomment the commented portion of publish.yml, and modify the steps for the desired behaviour (publishing a Docker image, publishing to PyPI, deploying documentation etc.)

Owner

  • Name: Imperial College London
  • Login: ImperialCollegeLondon
  • Kind: organization
  • Email: icgithub-support@imperial.ac.uk
  • Location: Imperial College London

Imperial College main code repository

GitHub Events

Total
  • Watch event: 2
  • Delete event: 33
  • Push event: 32
  • Pull request event: 67
  • Create event: 33
Last Year
  • Watch event: 2
  • Delete event: 33
  • Push event: 32
  • Pull request event: 67
  • Create event: 33

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 120
  • Total Committers: 7
  • Avg Commits per committer: 17.143
  • Development Distribution Score (DDS): 0.475
Past Year
  • Commits: 120
  • Committers: 7
  • Avg Commits per committer: 17.143
  • Development Distribution Score (DDS): 0.475
Top Committers
Name Email Commits
dependabot[bot] 4****] 63
pre-commit-ci[bot] 6****] 22
Adrian D'Alessandro a****o@i****k 20
Diego Alonso Álvarez 6****a 5
AdrianDAlessandro A****o 4
Alex Dewar a****r@i****k 3
Tom Bland t****d@h****k 3
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 3
  • Total pull requests: 204
  • Average time to close issues: 10 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 2
  • Total pull request authors: 8
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.11
  • Merged pull requests: 194
  • Bot issues: 0
  • Bot pull requests: 189
Past Year
  • Issues: 0
  • Pull requests: 39
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 39
  • Bot issues: 0
  • Bot pull requests: 39
Top Authors
Issue Authors
  • AdrianDAlessandro (2)
  • barneydobson (1)
Pull Request Authors
  • dependabot[bot] (167)
  • pre-commit-ci[bot] (99)
  • AdrianDAlessandro (6)
  • tsmbland (6)
  • github-actions[bot] (5)
  • alexdewar (4)
  • dalonsoa (3)
  • cc-a (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (167) python (161) github_actions (6)