Giter Site home page Giter Site logo

anaconda / anaconda-packaging-dotfiles Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 24 KB

Contains a set of standard dotfiles and configuration files to ensure a certain level of software standards in all new Python projects going forward.

License: BSD 3-Clause "New" or "Revised" License

Makefile 100.00%

anaconda-packaging-dotfiles's Introduction

anaconda-packaging-dotfiles

This repository contains a set of standard dotfiles and configuration files to ensure a minimum level of software standards for Anaconda packaging tooling in all new Python projects going forward.

These tools and standards have been proven and used in a number of our open source Python projects:

Primary Tools Being Used

  • black
    • Standard rule set, with modifications for isort compatibility and support for 120-column line lengths.
  • pylint
  • mypy
  • make
  • pre-commit
  • pytest
  • docconvert

On-boarding Process

File and Folder Structure

Most of the config files provided by this repository will have a TODO where a project name should be. Project names generally should start with anaconda- and use -'s to represent spaces. Underscores will need to be used in any corresponding package names.

Roughly, the project should look like:

/
|-- <dotfiles>
|-- <project_name_with_underscores>
    |-- __init__.py # An empty file
    |-- py.typed # An empty file
    |-- <Other source files and module folders>
|-- tests/
    |-- <pytest config files, `test_*.py`>
    |-- <test utility files>
    |-- test_aux_files/
        |-- <Auxiliary test files used in tests>

Steps

  1. Move the project into its own repository, if applicable. If not, incorporate the tool into an existing project
    1. Many package builder scripts may fall into the perseverance-scripts umbrella
  2. Establish which version(s) of Python we need to target. For now, new tools are targeting 3.11+
  3. Copy the dotfiles and configurations from this repository over. The following bullet points go into specific detail.
  4. Update the pyproject.toml as needed.
  5. Setup an environment.yaml file to ensure dependencies are installable by conda
  6. Setup the standard Makefile to ensure a consistent set of make targets across our projects.
    1. Not all of these will work until the following steps are configured.
  7. Setup pre-commit
    1. Our projects use pre-commit and make to enforce our code and test requirements. If done properly, make dev will create an environment with pre-commit automatically installed. Developers should be able to blow away and start over from scratch by just running make dev
  8. Setup and enforce some amount of unit test coverage with pytest. Eventually the goal should be at to require at least 80% coverage for your project.
  9. Setup and enforce our standard pylint rules
  10. Setup and enforce our standard mypy rules
  11. Setup GitHub Actions that run the pre-commit checks and unit tests on all supported versions of Python. Enforce that all PRs must pass these checks as merge requirements through the repository's GitHub settings. This requires the Actions to run on a PR at least once before they will show up in the GitHub settings page.
  12. If this is a library, configure the project to publish to the distro-tooling channel as a "typed" project and create an appropriate feedstock in aggregate.
  13. If this is CLI-based tool, consider using the click library to build a modular command line interface and Python's built-in logging module for logging errors, debug information, etc.

TODOs & Future Goals

  1. GitHub Workflows should use this shared configuration and set of minimum actions. This should be pulled in by new new projects, in one of the following ways (TBD):
    1. Each repository's GitHub Workflow can pull and execute the GitHub Workflow found in this project, configuring environment variables as needed.
    2. Repositories that can access GitHub Enterprise features can be configured to automatically run a common GitHub Workflow.
  2. Find a way to share/pull-in the dotfiles without copying-and-pasting files
    1. Some projects may need to modify the base file.
    2. This might add some breakage risk but should simplify the process of improving all projects at once.

anaconda-packaging-dotfiles's People

Contributors

schuylermartin45 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

anaconda-packaging-dotfiles's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/actions/setup-env/action.yaml
  • actions/setup-python v5.0.0@0a5c61591373683505ea898e09a3ea4f39ef2b9c
  • actions/cache v4.0.0@13aacd865c20de90d75de3b17ebe84f7a17d57d2
.github/workflows/ci.yaml
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/cache v4.0.0@13aacd865c20de90d75de3b17ebe84f7a17d57d2
pep621
pyproject.toml
  • setuptools >=61.0
pre-commit
.pre-commit-config.yaml
  • pre-commit/pre-commit-hooks v4.5.0
  • python-jsonschema/check-jsonschema 0.27.3
  • pycqa/isort 5.13.2
  • psf/black 23.12.1
  • PyCQA/pylint v3.0.3
  • pre-commit/mirrors-mypy v1.8.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.