Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pyCHX/_version.py export-subst
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v3
with:
fetch-depth: 1000 # should be enough to reach the most recent tag
fetch-depth: 1000 # should be enough to reach the most recent tag

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel twine setuptools
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel twine setuptools

- name: Build and publish
env:
TWINE_USERNAME: __token__
# The PYPI_PASSWORD must be a pypi token with the "pypi-" prefix with sufficient permissions to upload this package
# https://pypi.org/help/#apitoken
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Build and publish
env:
TWINE_USERNAME: __token__
# The PYPI_PASSWORD must be a pypi token with the "pypi-" prefix with sufficient permissions to upload this package
# https://pypi.org/help/#apitoken
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ docs/_build/
*.tiff
*.tif

#generated documntation files
#generated documentation files
doc/resource/api/generated/

# Enaml
Expand All @@ -99,3 +99,6 @@ __enamlcache__/

# PyBuilder
target/
# pixi environments
.pixi/*
!.pixi/config.toml
101 changes: 87 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,96 @@
exclude: '(v2)/.*'
default_language_version:
python: python3
ci:
autoupdate_commit_msg: "chore(deps): update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"
autoupdate_schedule: "quarterly"

exclude: "^({{cookiecutter\\.project_name}}|hooks/pre_gen_project.py$)"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: "v6.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/ambv/black
rev: 24.4.2

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.20.0"
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
- id: blacken-docs
additional_dependencies: [black==24.*]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.6"
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
- id: ruff-check
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: nbstripout
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.19.1"
hooks:
- id: mypy
files: "(src|tests|noxfile.py)"
args: []
additional_dependencies:
- click
- markdown-it-py
- pytest
- nox
- orjson
- repo-review>=0.10.6
- rich
- tomli>=2.0.2
- types-PyYAML

- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.8.1"
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]

- repo: https://github.com/crate-ci/typos
rev: "v1.44.0"
hooks:
- id: typos
exclude: ^Gemfile\.lock$

- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|RST|PyLint
exclude: (.pre-commit-config.yaml|docs/pages/guides/style\.md)$
- id: disallow-words
name: Disallow certain words
language: pygrep
entry: "[Ff]alsey"
exclude: .pre-commit-config.yaml$
- id: disallow-bad-permalinks
name: Disallow _ in permalinks
language: pygrep
entry: "^permalink:.*_.*"
- id: cog
name: Cog the pages
language: python
entry: cog -P -r -I ./helpers
files: "^docs/pages/guides/(packaging_compiled|docs|tasks|gha_basic).md|^copier.yml|^docs/_includes/pyproject.md"
additional_dependencies: [cogapp, cookiecutter, tomlkit]
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
pyCHX -- CHX XPCS Data Analysis Packages
========
# pyCHX -- CHX XPCS Data Analysis Packages

Repository for data collection and analysis scripts that are useful at the
CHX beamline at NSLS-II (11-ID) developed by Dr. Yugang Zhang (yuzhang@bnl.gov).
Repository for data collection and analysis scripts that are useful at the CHX
beamline at NSLS-II (11-ID) developed by Dr. Yugang Zhang (yuzhang@bnl.gov).

Installation instructions on Linux:

Install miniconda from https://conda.io/miniconda.html. Then create the environment for pyCHX:
Install miniconda from https://conda.io/miniconda.html. Then create the
environment for pyCHX:

```
conda create --name pyCHX python=3.6 numpy scipy matplotlib
source activate pyCHX
pip install -r https://raw.githubusercontent.com/NSLS-II-CHX/pyCHX/master/requirements.txt
pip install git+https://github.com/NSLS-II-CHX/pyCHX


Pixi Install:
- pixi install: installs only main dependencies
- pixi install --with dev: installs main and dev dependencies
- pixi run --with dev pytest: runs pytest with dev tols available
```
15 changes: 7 additions & 8 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
Steps for releasing a version of pyCHX


* Make sure that you have an up-to-date copy of the master branch.
* Make an empty commit to serve as a marker in the history. This is technically
optional, but it is nice to do. ``git commit --allow-empty -m "REL: v0.0.1"``
* Now make the tag. This should never be delete, so make sure you are certain.
``git tag v0.0.1``
* Push the commit up to github: ``git push upstream master``
* Push the tag also: ``git push upstream v0.0.1``
- Make sure that you have an up-to-date copy of the master branch.
- Make an empty commit to serve as a marker in the history. This is technically
optional, but it is nice to do. `git commit --allow-empty -m "REL: v0.0.1"`
- Now make the tag. This should never be delete, so make sure you are certain.
`git tag v0.0.1`
- Push the commit up to github: `git push upstream master`
- Push the tag also: `git push upstream v0.0.1`
Loading
Loading