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

DEV/MNT: migrate to latest standards with pyproject.toml [LCLSPC-603] #542

Merged
merged 35 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
33d86a1
MNT: bump isort for poetry bug
tangkong Feb 10, 2023
c5fe998
BLD: add build sectiion to conda recipe
tangkong Feb 10, 2023
ec95722
CLN: removing run_tests.py
tangkong Feb 10, 2023
3cff5a5
MNT: updating LICENSE from template
tangkong Feb 10, 2023
006f5d1
MNT: updating AUTHORS.rst from template
tangkong Feb 10, 2023
3f7e481
MNT: updating CONTRIBUTING.rst from template
tangkong Feb 10, 2023
9800513
MNT: updating .pre-commit-config.yaml from template
tangkong Feb 10, 2023
5fbb23b
MNT: updating .flake8 from template
tangkong Feb 10, 2023
7fd73c1
MNT: updating .coveragerc from template
tangkong Feb 10, 2023
14ecdd2
MNT: updating .git_archival.txt from template
tangkong Feb 10, 2023
1bcf47f
MNT: updating .gitattributes from template
tangkong Feb 10, 2023
034b74c
CI: migrate to GitHub actions
tangkong Feb 10, 2023
7f13b09
DOC: update Sphinx configuration
tangkong Feb 10, 2023
d0c4789
STY: update repository to Python 3.9+ standards
tangkong Feb 10, 2023
c45ccab
BLD: migrate to pyproject.toml
tangkong Feb 10, 2023
1f35d63
BLD: migrate to setuptools-scm
tangkong Feb 10, 2023
aca5014
BLD: update conda-recipe
tangkong Feb 10, 2023
051bd0b
MNT: cleaning code with pycln
tangkong Feb 10, 2023
ca58c45
MNT: 'pre-commit run'
tangkong Feb 10, 2023
b10d60c
MNT: finish up flake8 fixes
tangkong Feb 10, 2023
133a040
BLD: add PyQt5 to pip requirements, add conda build reqs, remove pin …
tangkong Feb 10, 2023
8159520
BLD: add pcdsdevices to conda-recipe, bump to py3.9
tangkong Feb 10, 2023
f93a6c2
TST: update test_cli_version
tangkong Feb 10, 2023
f33ca23
DOC: unpin sphinx
tangkong Feb 10, 2023
0cf84a4
BLD: move docs requirements to separate file
tangkong Feb 13, 2023
44da174
BLD: move sphinxcontrib-jquery
tangkong Feb 13, 2023
32b900a
BLD: clean up dev reqs
tangkong Feb 14, 2023
99680ac
DOC: docs_version_menu, underscores in conf.py
tangkong Feb 14, 2023
cd47b79
DOC: reference master pcdsdevices docs
tangkong Feb 14, 2023
c37951f
DOC: happi needed for typhos.plugins.register_client
tangkong Feb 14, 2023
d9178e8
TST: are these the only problematic tests?
tangkong Feb 14, 2023
aec2fc0
BLD: change development status
tangkong Feb 15, 2023
d6197a9
Revert "TST: are these the only problematic tests?"
tangkong Feb 15, 2023
6d9cc94
TST: skip and xfail tests to help suite pass
tangkong Feb 16, 2023
9383ebd
TST: use proper decorators...
tangkong Feb 16, 2023
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
6 changes: 3 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ source =
typhos
[report]
omit =
#tests
*/tests/*
*test*
#versioning
.*version.*
*_version.py
#tests
*test*
typhos/tests/*
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,typhos/_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 @@
typhos/_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:
- 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: "typhos"
# Extras that will be installed for both conda/pip:
testing-extras: "happi"
# Extras to be installed only for conda-based testing:
conda-testing-extras: "pcdsdevices pyqt=5"
tangkong marked this conversation as resolved.
Show resolved Hide resolved
# Extras to be installed only for pip-based testing:
pip-testing-extras: "PyQt5<5.15"
# Set if using setuptools-scm for the conda-build workflow
use-setuptools-scm: true
17 changes: 8 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# 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|
typhos/_version.py|
)$
(?x)^(
typhos/_version.py|
)$

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: no-commit-to-branch
- id: trailing-whitespace
Expand All @@ -23,12 +22,12 @@ repos:
exclude: '^(conda-recipe/meta.yaml)$'
- id: debug-statements

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

- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
rev: 5.11.5
hooks:
- id: isort
23 changes: 0 additions & 23 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/typhos/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
~~~~~~~~~~~~~~~~~~~

typhos could always use more documentation, whether
as part of the official typhos 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/typhos/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 `typhos` for local development.

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

$ git clone git@github.com:your_name_here/typhos.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 typhos python=3.9 pip
$ cd typhos/
$ 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.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016, 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
2 changes: 0 additions & 2 deletions conda-recipe/build.sh

This file was deleted.

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

package:
name : typhos
version : {{ data.get('version') }}
name: {{ package_name }}
version: {{ version }}

source:
path: ..
path: ..

build:
number: 0
noarch: python
entry_points:
- typhos = typhos.cli:main
script: {{ PYTHON }} -m pip install . -vv



requirements:
build:
- python >=3.7
tangkong marked this conversation as resolved.
Show resolved Hide resolved
- pip
- setuptools_scm
host:
- python >=3.7
- pip
- python >=3.7
- pip
run:
- python >=3.7
- coloredlogs
- entrypoints
- numpy
- numpydoc
- ophyd >=1.5.0
- pcdsutils
- pydm >=1.16.1
- pyqt >=5,<5.15
- pyqtgraph
- qdarkstyle
- qtawesome
- qtconsole
- qtpy
- timechart >=1.2.4
- python >=3.7
- coloredlogs
- entrypoints
- numpy
- numpydoc
- ophyd >=1.5.0
- pcdsutils
- pydm >=1.16.1
- pyqt >=5,<5.15
- pyqtgraph
- qdarkstyle
- qtawesome
- qtconsole
- qtpy
- timechart >=1.2.4
run_constrained:
- happi >=1.14.0
- jupyter_client <7.3.2
- happi >=1.14.0
- jupyter_client <7.3.2



test:
commands:
- typhos --help
imports:
- typhos
- typhos.cli



about:
home: https://github.com/pcdshub/typhos
doc_url: https://pcdshub.github.io/typhos
dev_url: https://github.com/pcdshub/typhos
summary: 'Automatic-yet-customizable Graphical User Interface Generation for Ophyd Devices'
doc_url: https://pcdshub.github.io/typhos
home: https://github.com/pcdshub/typhos
license: SLAC Open
license_family: OTHER
license_file: LICENSE.md
summary: Automatic-yet-customizable Graphical User Interface Generation for Ophyd
Devices


test:
imports:
- typhos
- typhos.cli
commands:
- typhos --help

extra:
recipe-maintainers:
- klauer
- hhslepicka
- zllentz
- klauer
- hhslepicka
tangkong marked this conversation as resolved.
Show resolved Hide resolved
- zllentz
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ pytest-timeout
sphinx<4.0.0
sphinx_rtd_theme
simplejson
sphinxcontrib-jquery
Loading