Giter VIP home page Giter VIP logo

nskit's Introduction

NSkit

Pipeline FOSSA Status Quality Gate Status codecov License PyPi Python Implementation Python Versions Downloads Issues Pull Requests

nskit is a python package that provides useful utilities and implementations for creating and managing a namespaced codebase for python and other programming languages.

Please see the documentation at https://djpugh.github.io/nskit for more information (the contribution guidelines can also be found at docs/source/developing/index.md)

nskit's People

Contributors

djpugh avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar

nskit's Issues

๐Ÿš€ FEATURE: Source environment variables from codebase root

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Environment variable sourcing uses the current working directory to look for .env files.

Desired Behavior

It would be nicer to use the codebase root as the starting point to look for the files

Anything else?

It might be better to have a separate(?) config format - .nskitconf that can be put at the root?

Add mkdocs.yml templates to python package recipes

Add some example/useful mkdocs templating to the package recipes.
Based on the nskit documentation approach, implement a simple mkdocs.yml, docs/source and stub files + mike
Update nox to include mike handling (for on and off CI)

๐Ÿž BUG: Validation Errors

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Unexpected validation errors on codebase creation.

With a .env configured, get

ValidationError: 6 validation errors for Codebase
settings.vcs_provider
  Value error, None is not a valid ProviderEnum [type=value_error, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.6/v/value_error
settings.nskit_codebase_vcs_provider
  Extra inputs are not permitted [type=extra_forbidden, input_value='****', input_type=str]
    For further information visit https://errors.pydantic.dev/2.6/v/extra_forbidden
settings.github_organisation
  Extra inputs are not permitted [type=extra_forbidden, input_value='*****', input_type=str]
    For further information visit https://errors.pydantic.dev/2.6/v/extra_forbidden
settings.github_token
  Extra inputs are not permitted [type=extra_forbidden, input_value='****', input_type=str]
    For further information visit https://errors.pydantic.dev/2.6/v/extra_forbidden
settings.github_interactive
  Extra inputs are not permitted [type=extra_forbidden, input_value='****', input_type=str]
    For further information visit https://errors.pydantic.dev/2.6/v/extra_forbidden
namespace_validation_repo
  Value error, 'NoneType' object has no attribute 'namespace_validation_repo' [type=value_error, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.6/v/value_error

Expected Behavior

It should ignore extras from the env file when creating

Steps To Reproduce

With version 0.1.1, try to create a codebase with a .env file configured with unexpected variables

Environment

- OS: Mac OS
- Python: 3.11
- library version: 0.1.1

Anything else?

No response

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/workflows/dependabot.yaml
  • dependabot/fetch-metadata v1
.github/workflows/pipeline.yaml
  • actions/checkout v4
  • tj-actions/changed-files v42
  • tj-actions/changed-files v42
  • tj-actions/changed-files v42
  • tj-actions/changed-files v42
  • tj-actions/changed-files v42
  • tj-actions/changed-files v42
  • actions/checkout v4
  • actions/setup-python v5
  • actions/checkout v4
  • actions/setup-python v5
  • codecov/codecov-action v4
  • testspace-com/setup-testspace v1
  • actions/checkout v4
  • actions/checkout v4
  • actions/setup-python v5
  • fossa-contrib/fossa-action v3
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • actions/checkout v4
  • actions/setup-python v5
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/download-artifact v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/download-artifact v4
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/pr-labeler.yaml
  • TimonVS/pr-labeler-action v5
.github/workflows/release-management.yaml
  • toolmantim/release-drafter v6.0.0
pep621
pyproject.toml
  • pydantic-settings >=2.2.0, <2.3.0
  • dev-lint/flake8 >=5.0.4
  • dev-lint/flake8-import-order >=0.18.2
  • dev-lint/flake8-eradicate >=1.4.0
  • dev-lint/flake8-docstrings >=0.2.7
  • dev-lint/flake8-pyproject >=1.2.3
  • dev-lint/flake8-bugbear >=22.0.0
  • dev-lint/flake8-comprehensions >=3.12.0
  • dev-lint/flake8-unused-arguments >=0.0.13
  • dev-lint/flake8-noqa >=1.3.1
  • dev-test/pytest >=7.3.1
  • dev-test/pytest-cov >=4
  • setuptools >= 40.9.0
  • setuptools_scm >=6.2

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

Make Jinja2 Environment easily extensible

The Jinja2 environment is currently implemented specifically for nskit.mixer. It would be great to add in custom extensions for templates etc.

Suggested Implementation

Define an entrypoint for adding extensions to the entrypoint - https://jinja.palletsprojects.com/en/3.0.x/extensions/#adding-extensions

Although there are a lot of Environment options:

      block_start_string
      block_end_string
      variable_start_string
      variable_end_string
      comment_start_string
      comment_end_string
      line_statement_prefix
      line_comment_prefix
      trim_blocks
      lstrip_blocks
      newline_sequence
      keep_trailing_newline
      extensions
      optimized
      undefined
      finalize
      autoescape
      loader
      cache_size
      auto_reload
      bytecode_cache
      enable_as

There are not any that will need customizing by specific implementations, but to keep the extensibility/reusability, we will also create a mechanism to define the Environment externally and provide it into the mixer methods (separate to the extensions part)

nskit.mixer.environment.extensions

Entrypoint to define specific extensions to be loaded (as strings). Providing library needs to make sure they are installed as dependencies.

Process the extensions and reduce them to a set of unique extensions.

nskit.mixer.environment.factory

Environment creator method that provides customisable environment creation. Set through NSKIT_MIXER_ENVIRONMENT_FACTORY environment variable, and run at first use of the environment object.

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.