Skip to content

Commit

Permalink
apply template
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Nov 11, 2023
1 parent 93fe6c5 commit 74d3b08
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 96 deletions.
7 changes: 7 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changes here will be overwritten by Copier
_commit: edb515f
_src_path: https://github.com/lenskit/lk-project-template
package_name: binpickle
project_name: binpickle
require_lint: true
start_year: 2020
10 changes: 8 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
root = true

[*]
insert_final_newline = true
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 4
indent_style = space

[*.{yml,yaml}]
[{*.json,*.yml,*.yaml,*.yml.jinja}]
indent_size = 2

[*.toml]
indent_size = 2

[*.sh]
end_of_line = lf

[*.{bat,cmd}]
end_of_line = crlf

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* text=auto
*.sh text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
74 changes: 74 additions & 0 deletions .github/workflows/check-sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Validate Source Rules
on:
push:
branches:
- main
pull_request:

concurrency:
group: check-${{github.ref}}
cancel-in-progress: true

jobs:
lint:
name: Check Source Style
runs-on: ubuntu-latest

steps:
- name: 📥 Check out source code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'

- name: 🛠️ Install tools
run: |
pip install ruff
- name: 🪮 Check source code formatting
id: format
run: |
if pipx run ruff format --diff $PKG_DIR; then
echo passed=yes >>"$GITHUB_OUTPUT"
else
echo passed=no >>"$GITHUB_OUTPUT"
echo "::error::source code not formatted"
fi
env:
PKG_DIR: binpickle

- name: 🐜 Check source code lint rules
id: lint
run: |
if pipx run ruff check --output-format=github $PKG_DIR; then
echo passed=yes >>"$GITHUB_OUTPUT"
else
echo passed=no >>"$GITHUB_OUTPUT"
echo "::error::source code lint check failed"
fi
env:
PKG_DIR: binpickle

- name: 🧾 Checking results
run: |
if [ "$FMT_PASSED" = no ]; then
echo "::error::format failed, failing build"
exit 1
fi
if [ "$LINT_PASSED" = no ]; then
if [ "$LINT_REQUIRED" = true ]; then
echo "::error::lint failed, failing build"
exit 2
else
echo "::error::lint failed but non-mandatory"
fi
fi
env:
FMT_PASSED: ${{ steps.fmt.outputs.passed }}
LINT_PASSED: ${{ steps.lint.outputs.passed }}
LINT_REQUIRED: True
53 changes: 27 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
# log and debug outputs
*.log
*.pdb
*.prof
*.lprof
emissions.csv
intel_power_gadget_log.csv
.coverage*
coverage.xml
cov-reports/
test-logs/
htmlcov/

# caches and working directories
__pycache__/
*.pyc
*.prof
*.lprof
.ipynb_checkpoints/
dask-worker-space/
.idea/
.vs/

.eggs/
.*_cache/
.vscode/
*.egg-info/
.hypothesis/
.tox/
.vagrant/
.venv/
scratch/

# build outputs
build/
dist/
.coverage*
coverage.xml
cov-reports/
test-logs/
htmlcov/
my-eval/
doc/data/
*.pyd
*.so
*.dll
*.exp
*.lib
*.o
*.obj

# environment locks that aren't committed
/*env*.yml
conda-lock.yml
*.lock
*.lock.yml
*.tar.bz2

dask-worker-space/
.hypothesis/

build-env/
.tox/
pythonenv*/
.vagrant/
scratch/
emissions.csv
intel_power_gadget_log.csv

# Editor and OS cruft
.DS_Store
._.DS_Store
*~
*.tmp
.vs/
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"

sphinx:
configuration: docs/conf.py
Expand Down
3 changes: 3 additions & 0 deletions .toplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[formatting]
array_auto_collapse = false
column_width = 100
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
},
}
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

7 changes: 4 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2018–2022 Boise State University
Copyright (c) 2020–2023 Boise State University
Copyright (c) 2023 Michael Ekstrand

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -7,8 +8,8 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand Down
85 changes: 42 additions & 43 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,68 @@ build-backend = "flit_core.buildapi"
[project]
name = "binpickle"
authors = [
{name = "Michael Ekstrand", email = "michaelekstrand@boisestate.edu"}
{name="Michael Ekstrand", email="mdekstrand@drexel.edu"}
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
]
requires-python = ">= 3.10"
readme = "README.md"
license = { file = "LICENSE" }
dynamic = ['version', 'description']
requires-python = ">= 3.8"
dynamic = ["version", "description"]
dependencies = [
"msgpack >= 1.0",
"msgpack >= 1.0",
]

[project.urls]
homepage = "https://binpickle.lenskit.org"
source = "https://github.com/lenskit/binpickle"

[project.optional-dependencies]
blosc = [
"blosc"
]
numcodecs = [
"numcodecs >= 0.10"
dev = [
"flit >=3.8",
"ruff",
"copier",
]
test = [
"pytest >= 5",
"pytest-cov",
"hypothesis >= 6",
"pandas >= 1.0",
"numpy >= 1.17"
"pytest >= 5",
"pytest-cov",
"hypothesis >= 6",
"pandas >= 1.0",
"numpy >= 1.17",
]
doc = [
"sphinx >=4",
"furo",
]
dev = [
"ruff ==0.1.*",
"rstcheck",
"flit >=3.2",
"sphinx >=4",
"furo",
]

[project.urls]
Homepage = "https://binpickle.lenksit.org"
GitHub = "https://github.com/lenskit/binpickle"

# configure build tools
[tool.flit.sdist]
include = ["tests/*"]
exclude = [
".github"
".github"
]

# need this for the SCM plugins to work
[tool.setuptools.packages.find]
exclude = ["envs"]

# settings for generating conda environments for dev & CI, when needed
[tool.pyproject2conda]
channels = ["conda-forge"]

[tool.ruff]
line-length = 100
target-version = "py38"
target-version = "py310"
exclude = [
".git",
"__pycache__",
"docs/conf.py",
"build",
"dist",
".git",
"__pycache__",
"docs/conf.py",
"build",
"dist",
]

[tool.pyproject2conda]
channels = ["conda-forge"]

0 comments on commit 74d3b08

Please sign in to comment.