Skip to content

Commit

Permalink
Merge pull request #1 from chrishavlin/initial_setup
Browse files Browse the repository at this point in the history
initial project setup
  • Loading branch information
matthewturk authored Nov 21, 2023
2 parents 29850b1 + 2d30a5a commit 930ce5c
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run tests
on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup yt_experiments
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
- name: Run tests
run: pytest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# pre-commit 1.1.0 is required for `exclude`
# however `minimum_pre_commit_version` itself requires 1.15.0
minimum_pre_commit_version: "1.15.0"


ci:
autofix_prs: false
autoupdate_schedule: monthly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: no-commit-to-branch
- id: check-shebang-scripts-are-executable
- id: check-executables-have-shebangs
- id: check-yaml

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1
hooks:
- id: black-jupyter

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.9.1]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
87 changes: 87 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "yt_experiments"
version = "0.1.0"
authors = [
{ name="The yt project", email="[email protected]"},
]
description="A repository containing some experimental packages and enhancements "
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: BSD License",
]
dependencies=['yt>4.2.0',]

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.urls]
"Homepage" = "https://github.com/yt-project/yt_experiments"
"Bug Tracker" = "https://github.com/yt-project/yt_experiments/issues"

[project.license]
text = "BSD 3-Clause"

[project.optional-dependencies]
test = [
"pytest>=6.1",
]

[tool.pytest.ini_options]
addopts = '''
-s
-v
-rsfE
'''

[tool.black]
line-length = 88
target-version = ['py39']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| build
| dist
)/
'''

[tool.ruff]
extend-include = ["*.ipynb"]
exclude = [
"doc",
]
select = [
"E",
"F",
"W",
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"G", # flake8-logging-format
"YTT", # flake8-2020
"UP", # pyupgrade
"I", # isort
"NPY", # numpy specific rules
]
ignore = [
"E501", # line too long
"B018", # Found useless expression. # disabled because ds.index is idiomatic
]

[tool.ruff.isort]
combine-as-imports = true
3 changes: 3 additions & 0 deletions yt_experiments/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from yt_experiments._version import __version__

version = __version__
1 change: 1 addition & 0 deletions yt_experiments/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.0"
5 changes: 5 additions & 0 deletions yt_experiments/tests/test_yt_experiments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import yt_experiments


def test_yt_experiments():
assert yt_experiments.version is not None

0 comments on commit 930ce5c

Please sign in to comment.