Code Monkey home page Code Monkey logo

template-sandbox's Introduction

Template-Sandbox

This project is a simple template that I am building for my own python projects. The setup and plan are based mostly on these pieces of writing and existing projects:

I am creating setup that suited my needs and preferences, while allowing me to learn the tools involved. That is why, if you read the references above, you will notice that some significant decisions are different, while the fundamental idea remains.

In the (near?) future I will convert this template-sandbox into a proper cruft/cookicutter/cookieninja template.

In the meantime, when you fork the project, you can set it up using these steps:

  1. conda create --name <environment name> --file conda-linux-64.lock
  2. poetry install --all-extras
  3. pre-commit install
  4. Get a URL with localtunnel: ./createtunnel.sh
  5. Setup an OAuth application for Woodpecker on Github.
  6. Setup a personal token for Renovate
  7. Create a TestPyPI account and token
  8. Fill in the missing variables from docker-compose.yml in new file called .env in the project root.
  9. Start the CI and Renovate with docker compose up -d
  10. Log in into the Woodpecker container (e.g. if nothing was changed, by going to localhost:8082)
  11. Enable the repository
  12. Add the TestPyPI token as a secret named test_pypi_token
  13. Check that the project can be built locally using nox

Components

Information Files

  • AUTHORS.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md

Environment and CUDA dependencies

  • Conda/Mamba

Dependency management

  • Poetry

Hooks

  • pre-commit

License management

  • REUSE
  • REUSE pre-commit hook

Testing

  • pytest
  • Coverage.py
  • pytest-cov
  • nox
  • pytest-mock
  • Hypothesis
  • MutMut

Lint

  • ruff (keep this in mind: ruff #2459)
  • ruff pre-commit hook
  • black
  • black pre-commit hook
  • safety
  • pylint
  • pre-commit-hooks
    • end-of-file-fixer
    • trailing-whitespace-fixer
    • check-yaml
    • debug-statements
    • check-added-large-files
    • check-ast

Type checking

  • Mypy (Consider dmypy in the future)
  • Mypy pre-commit hook (Consider removing due to time consumed)
  • Typeguard

Documentation

CI/CD

  • Trufflehog (Consider removing as pre-commit hook due to time, consider changing to detect-secrets due to license issues)
  • Woodpecker CI/CD setup (local) + Localtunnel script
  • Build recipe
  • Renovate
  • TestPyPI
  • PyPI (disabled by default)
  • ReadTheDocs (disabled by default)

Logging

  • structlog-sentry-logger

template-sandbox's People

Contributors

renovate-bot avatar rfguimaraes avatar

Watchers

 avatar

template-sandbox's Issues

Speed up CI/CD

CI/CD currently takes too long, perhaps use a finer grained selection of which nox sessions to run in which event.

Setup Renovate

Use Renovate to check dependencies and bill of materials.

Ideally, we should be able to add it as a service in the current docker-compose.yml.

Docstring style

Check whether the setup will allow us to move to other style of docstring and decide which.

Dependency Dashboard

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

This repository currently has no open or pending branches.

Detected dependencies

docker-compose
docker-compose-renovate.yml
  • renovate/renovate 36.25-slim
docker-compose.yml
  • woodpeckerci/woodpecker-server v1.0
  • woodpeckerci/woodpecker-agent v1.0
dockerfile
Dockerfile
  • python 3.11-slim
  • python 3.11-alpine
poetry
pyproject.toml
  • conda-lock ^2.0.0
  • structlog-sentry-logger ^1.0.1
  • requests ^2.31.0
  • cryptography ^41.0.0
  • reuse ^2.0.0
  • pre-commit ^3.2.1
  • pre-commit-hooks ^4.4.0
  • nox ^2023.0.0
  • detect-secrets ^1.4.0
  • pytest ^7.2.2
  • coverage ^7.2.2
  • pytest-cov ^4.0.0
  • pytest-mock ^3.10.0
  • hypothesis ^6.71.0
  • mutmut ^2.4.3
  • ruff ^0.0.280
  • black ^23.3.0
  • safety ^2.3.5
  • pylint ^2.17.2
  • mypy ^1.1.1
  • typeguard ^4.0.0
  • xdoctest ^1.1.1
  • sphinx ^7.0.0
  • myst-parser ^2.0.0
  • sphinx-autodoc-typehints ^1.22
  • towncrier ^23.0.0

Ruff is not fixing import orders

Ruff is missing some rules regarding imports and then pylint complains about import order.

Also, I would suggest combining the ability of ruff sorting imports into the black session (consider renaming it as well).

Migrate to Woodpecker v.1.0

We should migrate the CI configuration to v1.0.
Also, now that renovate is set up, we should replace the "latest" flag for the version.
Now, for instance, the configuration for woodpecker would break the CI/CD due to breaking changes from 0.15 to 1.0.

Fix message_to_shout docstring

The following warning is given when building the docs:

template_sandbox.greeter.message_to_shout:7: WARNING: Field list ends without a blank line; unexpected unindent

Towncrier build on docs session can break testing procedure

The changelog should only be compiled at release, while the rest of the documentation should be built "per contribution".
Hence, it would make more sense to add --draft to the call to towncrier in the docs session and document the updating the changelog in the release procedure (which should appear in the contributor's guide see #20).

Use bulk license for towncrier news pieces

Towncrier adds the content of the news pieces to the resulting changelog.

This means that all the SPDX headers added by reuse end in the changelog.

One alternative is to bulk license the markdown files in there via the .reuse/dep5 file.

Add pylint

It seems that ruff still does not implement important rules from pylint (astral-sh/ruff#970).

Thus, it is reasonable to add pylint by itself.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: Invalid JSON (parsing failed)
Message: Syntax error: expecting String near base"], }

Woodpecker only clones but runs no tests on pull request creation

Commit 3f4654122dbf51569b04260cda3c8008764565ddv excluded the tests tasks from pull request trigger, but it was a false problem. It is still relevant to run the CI pipeline when a pull request is created. Moreover, it surely does make sense to keep the clone task by itself.

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.