Skip to content

Commit

Permalink
Merge pull request #358 from klauer/mnt_migrate_gha
Browse files Browse the repository at this point in the history
DEV/MNT: migrate to GitHub Actions and pyproject.toml [LCLSPC-603]
  • Loading branch information
klauer authored Feb 23, 2023
2 parents 14f3ee2 + 4a8999f commit a393118
Show file tree
Hide file tree
Showing 48 changed files with 502 additions and 3,125 deletions.
23 changes: 23 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[flake8]
exclude = .git,__pycache__,build,dist,hutch_python/_version.py
max-line-length = 88
select = C,E,F,W,B,B950
extend-ignore = E203, E501, E226, W503, W504

# Explanation section:
# B950
# This takes into account max-line-length but only triggers when the value
# has been exceeded by more than 10% (96 characters).
# E203: Whitespace before ':'
# This is recommended by black in relation to slice formatting.
# E501: Line too long (82 > 79 characters)
# Our line length limit is 88 (above 79 defined in E501). Ignore it.
# E226: Missing whitespace around arithmetic operator
# This is a stylistic choice which you'll find everywhere in pcdsdevices, for
# example. Formulas can be easier to read when operators and operands
# have no whitespace between them.
#
# W503: Line break occurred before a binary operator
# W504: Line break occurred after a binary operator
# flake8 wants us to choose one of the above two. Our choice
# is to make no decision.
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hutch_python/_version.py export-subst
.git_archival.txt export-subst
30 changes: 30 additions & 0 deletions .github/workflows/standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PCDS Standard Testing

on:
push:
pull_request:
release:
types:
- created

jobs:
standard:
uses: pcdshub/pcds-ci-helpers/.github/workflows/python-standard.yml@master
with:
# The workflow needs to know the package name. This can be determined
# automatically if the repository name is the same as the import name.
package-name: "hutch_python"
# Extras that will be installed for both conda/pip:
testing-extras: ""
# Extras to be installed only for conda-based testing:
conda-testing-extras: "ipython=8.4.0"
# Extras to be installed only for pip-based testing:
pip-testing-extras: "ipython==8.4.0"
# System packages to be installed only for conda-based testing:
conda-system-packages: ""
# System packages to be installed only for pip-based testing:
pip-system-packages: ""
# System packages to be installed only for documentation:
docs-system-packages: "pandoc"
# Set if using setuptools-scm for the conda-build workflow
use-setuptools-scm: true
9 changes: 4 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: |
(?x)^(
versioneer.py|
docs/source/conf.py|
hutch_python/_version.py|
)$
(?x)^(
hutch_python/_version.py|
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=======
Credits
=======

Maintainer
----------

* SLAC National Accelerator Laboratory <>

Contributors
------------

Interested? See: `CONTRIBUTING.rst <CONTRIBUTING.rst>`_
103 changes: 103 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/pcdshub/hutch_python/issues.

If you are reporting a bug, please include:

* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

hutch-python could always use more documentation, whether
as part of the official hutch-python docs, in docstrings,
or even on the web in blog posts, articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/pcdshub/hutch_python/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `hutch_python` for local development.

1. Fork the `hutch_python` repo on GitHub.
2. Clone your fork locally::

$ git clone [email protected]:your_name_here/hutch_python.git

3. Install your local copy into a new conda environment. Assuming you have conda installed, this is how you set up your fork for local development::

$ conda create -n hutch_python python=3.9 pip
$ cd hutch_python/
$ pip install -e .

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. Install and enable ``pre-commit`` for this repository::

$ pip install pre-commit
$ pre-commit install

6. Add new tests for any additional functionality or bugs you may have discovered. And, of course, be sure that all previous tests still pass by running::

$ pytest -v

7. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

8. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put your
new functionality into a function with a docstring, and add the feature to
the list in README.rst.
3. The pull request should work for Python 3.9 and up. Check the GitHub Actions status
and make sure that the tests pass for all supported Python versions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017, The Board of Trustees of the Leland Stanford Junior
Copyright (c) 2023, The Board of Trustees of the Leland Stanford Junior
University, through SLAC National Accelerator Laboratory (subject to receipt
of any required approvals from the U.S. Dept. of Energy). All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
15 changes: 10 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
include versioneer.py
include AUTHORS.rst
include CONTRIBUTING.rst
include LICENSE
include MANIFEST.in
include README.rst

include dev-requirements.txt
include docs-requirements.txt
include requirements.txt

include hutch_python/_version.py
include hutch_python/templates/*
include hutch_python/logging.yml
include hutch_python/cookiecutter/*
include hutch_python/cookiecutter/*/*
include hutch_python/cookiecutter/*/*/*

include requirements.txt
include dev-requirements.txt
include LICENSE
39 changes: 0 additions & 39 deletions Makefile

This file was deleted.

1 change: 0 additions & 1 deletion conda-recipe/build.sh

This file was deleted.

75 changes: 41 additions & 34 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,59 @@
{% set data = load_setup_py_data() %}
{% set package_name = "hutch_python" %}
{% set import_name = "hutch_python" %}
{% set version = load_file_regex(load_file=os.path.join(import_name, "_version.py"), regex_pattern=".*version = '(\S+)'").group(1) %}

package:
name: hutch-python
version : {{ data.get('version') }}
name: {{ package_name }}
version: {{ version }}

source:
path: ..

build:
number: 1
number: 0
noarch: python
script: {{ PYTHON }} -m pip install . -vv

requirements:
build:
- python >=3.9
- setuptools

- python >=3.9
- setuptools_scm
- pip
run:
- python >=3.9
- archapp >=1.0.2
- bluesky >=1.8.0
- coloredlogs >=15.0.0
- cookiecutter >=1.7.0
- elog >=1.1.0
- happi >=1.9.0
- ipython >=7.26.0
- jinja2 >=2.11.0
- lightpath >=1.0.1
- matplotlib >=3.4.0
- nabs >=1.5.0
- pcdscalc >=0.3.0
- pcdsdaq >=2.3.0
- pcdsdevices >=7.0.0
- pcdsutils >=0.6.0
- psdaq-control-minimal >=3.3.19
- psdm_qs_cli >=0.3.1
- pyfiglet >=0.8.0
- pyqt <5.15.0
- pyyaml >=5.4.0
- requests >=2.26.0
- simplejson >=3.17.0
- python >=3.9
- archapp >=1.0.2
- bluesky >=1.8.0
- coloredlogs >=15.0.0
- cookiecutter >=1.7.0
- elog >=1.1.0
- happi >=1.9.0
- ipython >=7.26.0
- jinja2 >=2.11.0
- lightpath >=1.0.1
- matplotlib >=3.4.0
- nabs >=1.5.0
- pcdscalc >=0.3.0
- pcdsdaq >=2.3.0
- pcdsdevices >=7.0.0
- pcdsutils >=0.6.0
- psdaq-control-minimal >=3.3.19
- psdm_qs_cli >=0.3.1
- pyfiglet >=0.8.0
- pyqt <5.15.0
- pyyaml >=5.4.0
- requests >=2.26.0
- simplejson >=3.17.0

test:
imports:
- hutch_python
commands:
- hutch-python --help
- epicsarch-qs --help
- hutch-python --help
- epicsarch-qs --help
imports:
- hutch_python
requires:
- packaging
- pytest
- pytest-timeout

about:
home: https://github.com/pcdshub/hutch-python
Expand Down
Loading

0 comments on commit a393118

Please sign in to comment.