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

Setup standard ECS GH workflows #9

Merged
merged 34 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
455040c
Setup standard ECS GH workflows
slactjohnson Jul 17, 2024
5885163
Try with underscore rather than dash on package name
slactjohnson Jul 17, 2024
db0146c
Add dev-requirements.txt to pyproject.toml
slactjohnson Jul 17, 2024
70923f8
MNT: updating LICENSE from template
slactjohnson Jul 17, 2024
53faf2a
MNT: updating AUTHORS.rst from template
slactjohnson Jul 17, 2024
cc6db60
MNT: updating CONTRIBUTING.rst from template
slactjohnson Jul 17, 2024
d5f5c66
MNT: updating .pre-commit-config.yaml from template
slactjohnson Jul 17, 2024
d810c1e
MNT: updating .flake8 from template
slactjohnson Jul 17, 2024
b36a0a5
MNT: updating .coveragerc from template
slactjohnson Jul 17, 2024
7b717ec
MNT: updating .git_archival.txt from template
slactjohnson Jul 17, 2024
d6142d1
MNT: updating .gitattributes from template
slactjohnson Jul 17, 2024
6db134b
CI: migrate to GitHub actions
slactjohnson Jul 17, 2024
c60d466
DOC: update Sphinx configuration
slactjohnson Jul 17, 2024
86b6c01
STY: update repository to Python 3.9+ standards
slactjohnson Jul 17, 2024
0584731
BLD: update conda-recipe
slactjohnson Jul 17, 2024
dc65a7e
MNT: cleaning code with pycln
slactjohnson Jul 17, 2024
3c8f1bc
DEV: 'pre-commit autoupdate'
slactjohnson Jul 17, 2024
191812f
MNT: 'pre-commit run'
slactjohnson Jul 17, 2024
e65b028
Make more sophisticated pyproject.toml
slactjohnson Jul 17, 2024
1a545c4
Try underscore again
slactjohnson Jul 17, 2024
5dfe672
Actually read the error message and try to modify the right thing
slactjohnson Jul 17, 2024
51b5126
Try updating package name
slactjohnson Jul 17, 2024
aed0f7a
Try out PCDS _version.py
slactjohnson Jul 17, 2024
1d2adaa
Follow pcdsdevices __version__ example
slactjohnson Jul 17, 2024
38cfd8a
Add in flake8 linter ignore to __init__.py
slactjohnson Jul 17, 2024
ffa2329
Make the dummy test pass
slactjohnson Jul 17, 2024
3acf10c
Fix precommit issues
slactjohnson Jul 17, 2024
98d55e7
Fix pre-commit-config.yaml _version path
slactjohnson Jul 17, 2024
8c7e186
Fix flake8 path
slactjohnson Jul 17, 2024
9b10cd6
Fix flake8 errors in dummy test
slactjohnson Jul 17, 2024
bb75759
Fix path to exclude tests from flake8
slactjohnson Jul 17, 2024
9a79bbc
Remove pin on pyqt to try to appease CI
slactjohnson Jul 17, 2024
e9e408a
Make project name consistent with conda package name in pyproject.toml
slactjohnson Jul 18, 2024
f97735c
Update pyproject.toml
slactjohnson Jul 18, 2024
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: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
source =
btms_ui
btms-ui
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your experience here is why I dislike using dashes at all in package names

[report]
omit =
#versioning
Expand Down
22 changes: 20 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
[flake8]
exclude = .git,__pycache__,build,dist,versioneer.py,btms_ui/_version.py,docs/source/conf.py
exclude = .git,__pycache__,build,dist,btms_ui/_version.py
max-line-length = 88
select = C,E,F,W,B,B950
extend-ignore = E203, E501
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 @@
btms_ui/_version.py export-subst
.git_archival.txt export-subst
24 changes: 24 additions & 0 deletions .github/workflows/standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PCDS Standard Testing

on:
push:
pull_request:
release:
types:
- published

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: "btms_ui"
# Extras that will be installed for both conda/pip:
testing-extras: ""
# Extras to be installed only for conda-based testing:
conda-testing-extras: ""
# Extras to be installed only for pip-based testing:
pip-testing-extras: ""
# Set if using setuptools-scm for the conda-build workflow
use-setuptools-scm: true
13 changes: 9 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: |
(?x)^(
btms_ui/_version.py|
)$

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.6.0
hooks:
# - id: no-commit-to-branch
- id: no-commit-to-branch
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-ast
Expand All @@ -18,11 +23,11 @@ repos:
- id: debug-statements

- repo: https://github.com/pycqa/flake8.git
rev: 3.9.2
rev: 7.1.0
hooks:
- id: flake8

- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Maintainer
Contributors
------------

Interested? See: CONTRIBUTING.rst
Interested? See: `CONTRIBUTING.rst <CONTRIBUTING.rst>`_
24 changes: 12 additions & 12 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Types of Contributions
Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/pcdshub/btms_ui/issues.
Report bugs at https://github.com/pcdshub/btms-ui/issues.

If you are reporting a bug, please include:

Expand Down Expand Up @@ -42,7 +42,7 @@ 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/btms_ui/issues.
The best way to send feedback is to file an issue at https://github.com/pcdshub/btms-ui/issues.

If you are proposing a feature:

Expand All @@ -54,17 +54,17 @@ If you are proposing a feature:
Get Started!
------------

Ready to contribute? Here's how to set up `btms_ui` for local development.
Ready to contribute? Here's how to set up `btms-ui` for local development.

1. Fork the `btms_ui` repo on GitHub.
1. Fork the `btms-ui` repo on GitHub.
2. Clone your fork locally::

$ git clone git@github.com:your_name_here/btms_ui.git
$ git clone git@github.com:your_name_here/btms-ui.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 btms_ui python=3.7
$ cd btms_ui/
$ conda create -n btms-ui python=3.9 pip
$ cd btms-ui/
$ pip install -e .

4. Create a branch for local development::
Expand All @@ -73,13 +73,14 @@ Ready to contribute? Here's how to set up `btms_ui` for local development.

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8::
5. Install and enable ``pre-commit`` for this repository::

$ flake8 btms_ui
$ 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::

$ python run_tests.py -v
$ pytest -v

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

Expand All @@ -98,6 +99,5 @@ Before you submit a pull request, check that it meets these guidelines:
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.5 and up. Check
https://travis-ci.org/pcdshub/btms_ui/pull_requests
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
3 changes: 1 addition & 2 deletions btms_ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from . import _version
__version__ = _version.get_versions()['version']
from ._version import __version__ # noqa: F401
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be missing when running interactively since it's generated by setuptools_scm later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I fully understand here, but it's working interactively on my clone. Once this is merged I can set up a clean clone and test that it still works interactively, and if not set up a new issue/PR to resolve that.


__all__ = []
Loading