Skip to content

Commit

Permalink
Merge pull request #201 from maxfordham/195-add-github-action-workflo…
Browse files Browse the repository at this point in the history
…w-for-unit-tests

✨ Add workflow and issue templates
  • Loading branch information
ollyhensby authored Oct 10, 2023
2 parents df45a99 + caf4ad2 commit 8e36919
Show file tree
Hide file tree
Showing 33 changed files with 188 additions and 360 deletions.
47 changes: 0 additions & 47 deletions .circleci/config.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: "\U0001F41B "
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor_maintainence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Refactoring / maintenance
about: Updates and improvements
title: "♻️ "
labels: enhancement
assignees: ''
---

**Describe the upkeep / improvement you'd like to see**
A clear and concise description of what the bug is.

**What aspect of the repo is it likely to impact?**

**How urgent?**

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
82 changes: 82 additions & 0 deletions .github/workflows/test-python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test Python Package (Cached Conda Environment)

on:
push:
branches:
- '*'

pull_request:
branches:
- '*'

schedule:
- cron: '0 0 * * *'

env:
CACHE_NUMBER: 0 # increase to reset cache manually

jobs:
build:

strategy:
matrix:
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/my-env

# Add macOS and Windows builds here if you need them
# - os: macos-latest
# label: osx-64
# prefix: /Users/runner/miniconda3/envs/my-env

# - os: windows-latest
# label: win-64
# prefix: C:\Miniconda3\envs\my-env

name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: my-env
use-mamba: true

- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV

- uses: actions/cache@v2
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache

- name: Update environment
run: mamba env update -n my-env -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install flake8
run: |
conda install -n my-env flake8
- name: Lint with flake8
shell: bash -l {0}
run: |
# stop the build if there are Python syntax errors or undefined names
# Ignore scripts folder as mainly archived scripts
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install pytest
run: |
conda install -n my-env pytest
- name: Run tests
shell: bash -l {0}
run: pytest ./tests
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $ git clone https://github.com/maxfordham/ipyautoui
$ cd ipyautoui

# assuming that you have `mamba` installed:
$ mamba env create -f environment-dev.yml
$ mamba env create -f environment.yml

# run tests
$ pytest
Expand Down
6 changes: 0 additions & 6 deletions conda-build.sh

This file was deleted.

6 changes: 0 additions & 6 deletions conda.recipe/conda_build_config.yaml

This file was deleted.

48 changes: 0 additions & 48 deletions conda.recipe/meta.yaml

This file was deleted.

File renamed without changes.
Empty file removed log.txt
Empty file.
1 change: 1 addition & 0 deletions src/ipyautoui/autoanyof.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def _select(self, on_change):
from enum import Enum
from ipyautoui.automapschema import _init_model_schema
from typing_extensions import Annotated
from IPython.display import display

class MyEnum(str, Enum):
state1 = "state1"
Expand Down
1 change: 1 addition & 0 deletions src/ipyautoui/autoform.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# +
import ipywidgets as w
import traitlets as tr
import typing as ty

from IPython.display import display, clear_output
from ipyautoui.constants import BUTTON_WIDTH_MIN
Expand Down
1 change: 1 addition & 0 deletions src/ipyautoui/autovjsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# %run _dev_sys_path_append.py
# %load_ext lab_black

import pathlib
import ipyvuetify as v
import traitlets as tr
import ipywidgets as w
Expand Down
Loading

0 comments on commit 8e36919

Please sign in to comment.