-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Only CI on main and PRs * Update system_info function Fixes #252 * Add a little more to the readme * Reformat license so that GH detects it * Add a contributing guide * Update dkist/utils/sysinfo.py Co-authored-by: Drew Leonard <[email protected]> --------- Co-authored-by: Drew Leonard <[email protected]>
- Loading branch information
Showing
6 changed files
with
145 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Contribute | ||
|
||
We love contributions! `dkist` is open source, built on open source, and we'd love to have you hang out in our community. | ||
|
||
**Imposter syndrome disclaimer**: We want your help. No, really. | ||
|
||
There may be a little voice inside your head that is telling you that you're not ready to be an open source contributor; that your skills aren't nearly good enough to contribute. | ||
What could you possibly offer a project like this one? | ||
|
||
We assure you - the little voice in your head is wrong. | ||
If you can write code at all, you can contribute code to open source. | ||
Contributing to open source projects is a fantastic way to advance one's coding skills. | ||
Writing perfect code isn't the measure of a good developer (that would disqualify all of us!); it's trying to create something, making mistakes, and learning from those mistakes. | ||
That's how we all improve, and we are happy to help others learn. | ||
|
||
Being an open source contributor doesn't just mean writing code, either. | ||
You can help out by writing documentation, tests, or even giving feedback about the project (and yes - that includes giving feedback about the contribution process). | ||
Some of these contributions may be the most valuable to the project as a whole, because you're coming to the project with fresh eyes, so you can see the errors and assumptions that seasoned contributors have glossed over. | ||
|
||
Note: This disclaimer was originally written by [Adrienne Lowe](https://github.com/adriennefriend) for a [PyCon talk](https://www.youtube.com/watch?v=6Uj746j9Heo), and was adapted by dkist based on its use in the README file for the [MetPy project](https://github.com/Unidata/MetPy). | ||
|
||
|
||
## Provide Feedback | ||
|
||
We could always use more voices and opinions in the discussions about dkist and its development from both users and developers. | ||
You may want to suggest a new feature or tell us about how something is not working in the manner you would expect it to. | ||
There are a number of ways to make your voice heard and we would love to hear from you. | ||
|
||
We strongly recommend that your first port of call would be to our lovely [matrix channel]. | ||
Here you can get in easily get in touch with developers or users for questions or support. | ||
|
||
## Report Bugs | ||
|
||
If you run into unexpected behavior or run into a bug we urge you to please report it. | ||
All bugs are kept track of on our [issue tracker]. | ||
You can add a bug report there or you can report it on [matrix channel]. | ||
Ideally, we would like a short code example so we can reproduce the bug on our own machines. | ||
|
||
## Provide Code | ||
|
||
If you are interested in contributing fixes, code or documentation to dkist please have a read of the SunPy's [newcomers guide] as it's an excellent introduction to contributing. | ||
|
||
dkist uses a distributed version control system called [git] and the code is hosted on [GitHub]. | ||
To get started, create an account [on github] and fork dkist then submit your changes via a pull request. | ||
If you are unfamiliar with this style of development, Astropy provide a sample [workflow] but you can also find lots of [tutorials] online. | ||
You can browse our [issue list] to find something that you can tackle. | ||
Please leave a comment on the issue on [GitHub] and stop by the [matrix channel] to let people know what you are planning to work on. | ||
|
||
[matrix channel]: https://app.element.io/#/room/#dki-solar-telescope:openastronomy.org | ||
[issue tracker]: https://github.com/DKISTDC/dkist/issues | ||
[issue list]: https://github.com/dkist/dkist/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22 | ||
[newcomers guide]: https://docs.dkist.org/en/latest/dev_guide/contents/newcomers.html | ||
[developer guide]: https://docs.dkist.org/en/latest/dev_guide/ | ||
[git]: https://git-scm.com | ||
[github]: https://github.com/DKISTDC/dkist/ | ||
[on github]: https://help.github.com/en/articles/signing-up-for-a-new-github-account | ||
[workflow]: https://docs.astropy.org/en/stable/development/workflow/development_workflow.html#development-workflow | ||
[tutorials]: https://readwrite.com/2013/09/30/understanding-github-a-journey-for-beginners-part-1#awesm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2019-2022, NSO / AURA | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, this | ||
list of conditions and the following disclaimer in the documentation and/or | ||
other materials provided with the distribution. | ||
* Neither the names of DKIST, NSO or AURA nor the names of | ||
the contributors may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,45 @@ | ||
import platform | ||
from importlib.metadata import version, distribution | ||
|
||
from pkg_resources import get_distribution | ||
|
||
from sunpy.extern.distro import linux_distribution | ||
from sunpy.util.sysinfo import find_dependencies | ||
import sunpy.extern.distro as distro | ||
from sunpy.util.sysinfo import find_dependencies, get_keys_list, get_requirements | ||
|
||
__all__ = ['system_info'] | ||
|
||
|
||
def system_info(): | ||
""" | ||
Display information about your system for submitting bug reports. | ||
Prints one's system info in an "attractive" fashion. | ||
""" | ||
base_reqs = get_distribution("dkist").requires() | ||
base_reqs = {base_req.name.lower() for base_req in base_reqs} | ||
|
||
missing_packages, installed_packages = find_dependencies(package="dkist") | ||
package_name = "dkist" | ||
requirements = get_requirements(package_name) | ||
base_reqs = get_keys_list(requirements['required']) | ||
missing_packages, installed_packages = find_dependencies(package=package_name) | ||
extra_prop = {"System": platform.system(), | ||
"Arch": f"{platform.architecture()[0]}, ({platform.processor()})", | ||
"Python": platform.python_version(), | ||
"SunPy": get_distribution("dkist").version} | ||
package_name: version(package_name)} | ||
sys_prop = {**installed_packages, **missing_packages, **extra_prop} | ||
|
||
print("==============================") | ||
print("DKIST Installation Information") | ||
print("==============================") | ||
title_str = f"{package_name} Installation Information" | ||
print("=" * len(title_str)) | ||
print(title_str) | ||
print("=" * len(title_str)) | ||
print() | ||
print("General") | ||
print("#######") | ||
if sys_prop['System'] == "Linux": | ||
distro = " ".join(linux_distribution()) | ||
print(f"OS: {distro} (Linux {platform.release()})") | ||
print(f"OS: {distro.name()} ({distro.version()}, Linux {platform.release()})") | ||
elif sys_prop['System'] == "Darwin": | ||
print(f"OS: Mac OS {platform.mac_ver()[0]}") | ||
elif sys_prop['System'] == "Windows": | ||
print(f"OS: Windows {platform.release()} {platform.version()}") | ||
else: | ||
print("Unknown OS") | ||
for sys_info in ['Arch', 'SunPy']: | ||
print('{} : {}'.format(sys_info, sys_prop[sys_info])) | ||
for sys_info in ['Arch', package_name]: | ||
print(f'{sys_info}: {sys_prop[sys_info]}') | ||
print(f'Installation path: {distribution(package_name)._path}') | ||
print() | ||
print("Required Dependices") | ||
print("###################") | ||
print("Required Dependencies") | ||
print("#####################") | ||
for req in base_reqs: | ||
print('{}: {}'.format(req, sys_prop[req])) | ||
print(f'{req}: {sys_prop[req]}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import dkist | ||
|
||
|
||
def test_system_info(capsys): | ||
""" | ||
A very minimal test for system_info to test it runs. | ||
""" | ||
dkist.system_info() | ||
captured_output = capsys.readouterr().out | ||
assert "dkist Installation Information" in captured_output | ||
assert f"dkist: {dkist.__version__}" in captured_output |