Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installation #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 25 additions & 43 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,25 @@ repos:
name: ensure we are not committing to branch `main`
args:
- --branch=main

# Make sure all imports are absolute in Python files.
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
name: format Python imports using absolufy-imports
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=lf
- id: name-tests-test
args:
- --pytest-test-first
- id: pretty-format-json
args:
- --autofix
- id: trailing-whitespace

# Sort Python imports using `isort`.
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: sort Python imports using isort
Expand All @@ -30,22 +38,16 @@ repos:
- --trailing-comma
- --use-parentheses

# Remove unused `# noqa` comments
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa

# Remove all unused imports for Python files.
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.5
rev: v2.4.0
hooks:
- id: pycln
name: remove unused Python imports using pycln

# Python formatting
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black
name: format Python code using black
Expand All @@ -55,7 +57,7 @@ repos:

# Lint Python files using `ruff`.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.275
rev: v0.4.8
hooks:
- id: ruff
name: lint Python using ruff
Expand All @@ -67,7 +69,7 @@ repos:

# Markdown formatting
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
rev: 0.7.17
hooks:
- id: mdformat
name: format Markdown using mdformat
Expand All @@ -76,49 +78,29 @@ repos:
additional_dependencies:
- mdformat-myst==0.1.5
- mdformat_tables==0.4.1
- mdformat-frontmatter==2.0.1

# YAML formatting
- repo: https://github.com/lyz-code/yamlfix
rev: 1.11.0
hooks:
- id: yamlfix
name: format YAML using yamlfix
args:
- ./

# TOML formatting
- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.0
hooks:
- id: taplo
name: format TOML using taplo
args:
- format
- --config=.taplo.toml

# Check docstrings are formatted correctly
- repo: https://github.com/jsh9/pydoclint
rev: 0.0.13
rev: 0.4.1
hooks:
- id: pydoclint
args:
- --config=pyproject.toml

# Run `flake8` on Python files.
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
name: inspect Python code using flake8
args:
- --verbose
additional_dependencies:
- flake8-annotations==3.0.1
- flake8-builtins==2.1.0
- flake8-annotations==3.1.1
- flake8-builtins==2.5.0
- flake8-debugger==4.1.2
- flake8-docstrings==1.7.0
- flake8-eradicate==1.5.0
- flake8-markdown==0.4.0
- flake8-markdown==0.5.0
- flake8-print==5.0.0
- flake8-pyproject==1.2.3
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,28 @@ same view and interact with them.

### Contributor installation

Clone the repo locally and `cd` into it.

```bash
git clone the https://github.com/arviz-devs/arviz_dashboard
cd arviz_dashboard
```

We will use `mamba` to create a virtual environment where we will install a development version of
ArviZ Dashboard. The first step is to follow the instructions here
[https://github.com/conda-forge/miniforge#mambaforge](https://github.com/conda-forge/miniforge#mambaforge)
to install the correct version of `mamba` for your operating system. **Note** that if you have
`conda` installed already, you can exchange the command `mamba` for `conda` with the same results.

```bash
mamba create --name arviz-dashboard pip python
mamba activate arviz-dashboard
mamba env create --file environment.yaml
mamba activate arviz-dashboard-dev
```

Once the virtual environment has been created, and you have activated it with the above commands,
you can install the development requirements for `arviz_dashboard` with the following commands.
Once the virtual environment has been created and activated, you can install the development
requirements for `arviz_dashboard` using `pip`.

```bash
git clone the https://github.com/arviz-devs/arviz_dashboard
cd arviz_dashboard
pip install --editable .[dev,examples]
```

Expand Down
11 changes: 11 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: arviz-dashboard-dev

channels:
- conda-forge

dependencies:
- python =3.11

# Package managers
- nodejs
- pip
92 changes: 29 additions & 63 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "setuptools-scm"]

[project]
authors = [{name = "arviz-devs"}]
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Scientific/Engineering :: Mathematics",
"Development Status :: 1 - Planning",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Scientific/Engineering :: Mathematics",
]
dependencies = ["arviz>0.15", "jupyterlab>4.0", "panel<1.0"]
description = "Bayesian Dashboards built on top of Panel"
dependencies = [
"arviz",
"bokeh",
"jupyterlab",
"panel",
]
description = "Dashboards for Bayesian modeling"
dynamic = ["version"]
keywords = []
license = {file = "LICENSE"}
Expand All @@ -29,7 +34,12 @@ readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">3.9"

[project.optional-dependencies]
dev = ["pre-commit"]
dev = [
"ipdb",
"pre-commit",
"pyre-check",
]
test = ["pytest", "pytest-cov"]
examples = ["pymc"]

[project.urls]
Expand All @@ -38,49 +48,5 @@ examples = ["pymc"]
"Homepage" = "https://github.com/arviz-devs/arviz_dashboard"
"Repository" = "https://github.com/arviz-devs/arviz_dashboard"

[tool.hatch.version]
path = "src/arviz_dashboard/__init__.py"

[tool.isort]
force_grid_wrap = 0
include_trailing_comma = true
line_length = 100
multi_line_output = 3
profile = "black"
use_parentheses = true

[tool.black]
line-length = 100

[tool.ruff]
line-length = 100
per-file-ignores = {"__init__.py" = ["F401"]}

[tool.pycln]
all = true
disable_all_dunder_policy = true
expand_stars = true
extend_exclude = "__init__.py"
path = "src/arviz_dashboard"
verbose = true

[tool.yamlfix]
explicit_start = false
line_length = 100
section_whitelines = 1
sequence_style = "block_style"
whitelines = 1

[tool.flake8]
ignore = [
"ANN002", # missing type annotations for *args
"ANN003", # missing type annotations for *kwargs
"D100", # missing docstring in public module
"D104", # missing docstring in public package
"D107", # missing docstring in __init__ methods of classes
]
max-line-length = 100
per-file-ignores = ["__init__.py:F401"]

[tool.pydoclint]
style = "numpy"
[tool.setuptools.dynamic]
version = {attr = "arviz_dashboard.__version__"}