Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
travishathaway committed Jul 26, 2024
0 parents commit 1e7d5bd
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: conda-rich tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies (conda)
run: |
conda env update --file environment.yml --name base
conda install --file requirements.dev.txt
- name: Install conda-basic-auth
run: |
pip install -e .
- name: Test with pytest
run: |
pytest --doctest-modules
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
exclude: "(mkdocs.yml|recipe/meta.yaml)"
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: '' # Use the sha / tag you want to point at
hooks:
- id: mypy
additional_dependencies: ['types-requests']
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py310-plus"]
- repo: https://github.com/akaihola/darker
rev: 1.5.1
hooks:
- id: darker
additional_dependencies: [black==22.10.0]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2024, Travis Hathaway

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TODO: Please consider submitting a PR to the [conda-incubator/plugins] repo with a link to your new plugin!

# conda-rich

Demonstration project utilizing the "rich" library for conda
Empty file added conda-rich/__init__.py
Empty file.
20 changes: 20 additions & 0 deletions conda-rich/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Insert your plugin hook definitions
We have illustrated how this is done by defining a simple "hello conda"
subcommand for you.
"""

from conda.plugins import hookimpl, CondaSubcommand


@hookimpl
def conda_subcommands():
def hello_conda(args):
print("Hello conda!")

yield CondaSubcommand(
name="hello",
action=hello_conda,
summary="Command that prints \"Hello conda!\""
)
Empty file added conda-rich/py.typed
Empty file.
6 changes: 6 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: conda-rich
channels:
- conda-forge
dependencies:
- python>=3.8
- conda-canary/label/dev::conda
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[mypy]
warn_no_return = False
exclude = "stubs/*"
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "conda-rich"
version = "0.1.0"
description = "Demonstration project utilizing the "rich" library for conda"
requires-python = ">=3.8"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
]
dependencies = [
"conda",
]

[project.entry-points.conda]
conda-rich = "conda-rich.hooks"

[tool.setuptools]
packages = ["conda-rich"]
8 changes: 8 additions & 0 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
conda-forge::darker
conda-forge::flake8
conda-forge::mypy
conda-forge::pyupgrade
conda-forge::pytest
conda-forge::pytest-cov
conda-forge::pytest-mock
conda-forge::pre-commit
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 99
ignore = E126,E133,E226,E241,E242,E302,E704,E731,E722,W503,E402,W504,F821,E203
4 changes: 4 additions & 0 deletions tests/test_placeholder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@


def test_placeholder():
assert 1 + 1 == 2

0 comments on commit 1e7d5bd

Please sign in to comment.