Skip to content

Commit

Permalink
Merge pull request #141 from conda/cep-devel
Browse files Browse the repository at this point in the history
Merge `cep-devel` into `main`
  • Loading branch information
jaimergp authored Aug 15, 2023
2 parents 8c07e14 + 90f9db5 commit 6a256c5
Show file tree
Hide file tree
Showing 94 changed files with 6,573 additions and 3,218 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 99
66 changes: 66 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Docs

on:
# Runs on pushes targeting the default branch
push:
branches:
- main
pull_request:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allow one concurrent deployment
concurrency:
group: pages-${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
docs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: menuinst-docs
environment-file: docs/environment.yml
python-version: '3.11'
auto-activate-base: false

- name: Build Documentation
run: |
pip install -e .
cd docs
make dirhtml SPHINXOPTS="-W --keep-going -n"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'docs/_build/dirhtml'

pages:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
needs: [docs]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
76 changes: 55 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,84 @@
name: Tests

on: [push, pull_request]
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
pull_request:
branches:
- main
paths-ignore:
- "docs/**"

concurrency:
# Concurrency group that uses the workflow name and PR number if available
# or commit SHA as a fallback. If a new build is triggered under that
# concurrency group while a previous build is running it will be canceled.
# Repeated pushes to a PR will cancel all previous builds, while multiple
# merges to main will not cancel.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
run_test_suite:
name: ${{ matrix.os }}-py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 30
timeout-minutes: 60
env:
test-dependencies: pytest pytest-cov conda
CONDA_NUMBER_CHANNEL_NOTICES: 0
PYTHONUNBUFFERED: 1
strategy:
fail-fast: false
matrix:
os: [windows]
python-version: [3.7, 3.8, 3.9]
os: [windows, ubuntu, macos]
python-version: ["3.8", "3.9", "3.10"] # "3.11"]

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
fetch-depth: 0

- name: Add Linux dependencies
if: matrix.os == 'ubuntu'
run: |
sudo apt-get install libfile-mimeinfo-perl desktop-file-utils
echo "XDG_UTILS_DEBUG_LEVEL=2" >> $GITHUB_ENV
echo "XDG_CURRENT_DESKTOP=GNOME" >> $GITHUB_ENV
- name: Install dependencies
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: false
environment-name: test
channels: conda-canary/label/conda-conda-pr-11882,conda-forge
extra-specs: |
python=${{ matrix.python-version }}
conda-canary/label/conda-conda-pr-11882::conda
pip
pytest
pytest-cov
pydantic <2.0a0
hypothesis
hypothesis-jsonschema
- shell: bash -l {0}
- shell: bash -el {0}
name: Conda info
run: |
conda info
conda list
- shell: bash -l {0}
name: Install dependencies
run: |
conda install ${{ env.dependencies }} ${{ env.test-dependencies }}
conda list
- shell: bash -l {0}
- shell: bash -el {0}
name: Install menuinst
run: |
pip install -e .
python -m pip install -vv .
conda list
- shell: bash -l {0}
- shell: bash -el {0}
name: Run test suite
run: |
pytest tests --cov-append --cov-report=xml --cov=menuinst
python -I -m pytest tests/ --cov-append --cov-report=xml --cov=menuinst -vvv
- uses: codecov/codecov-action@v1
with:
Expand Down
149 changes: 142 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,145 @@
# file types to ignore
*.pyc
*.pyd
*~
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# ignore the build directories
*.egg-info/
# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
.cache/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# MacOS
.DS_Store
.build

# setuptools-scm
menuinst/_version.py
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# disable autofixing PRs, commenting "pre-commit.ci autofix" on a pull request triggers a autofix
ci:
autofix_prs: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: debug-statements
- id: detect-private-key
- id: mixed-line-ending
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-yaml
- id: check-merge-conflict
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
args: [--skip-string-normalization]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
5 changes: 4 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
include versioneer.py
include menuinst/_version.py
include menuinst/data/*.json
include menuinst/data/osx_launcher_*
include menuinst/data/appkit_launcher_*
exclude *.h *.cpp
Loading

0 comments on commit 6a256c5

Please sign in to comment.