Skip to content

Release 0.5.0 #53

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

Merged
merged 35 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
91eeb00
CI job for black formatting
kchason Mar 21, 2022
5c75d60
Centralize namespace constants in namespace.py
ajnelson-nist Mar 24, 2022
6a690cf
Merge pull request #44 from casework/release-0.4.0
ajnelson-nist Mar 24, 2022
cd2e528
Fix unused variable reference
ajnelson-nist Apr 18, 2022
5df4a05
Merge pull request #46 from casework/fix_test_query
ajnelson-nist Apr 18, 2022
2b285e1
Merge branch 'develop' into Issue_38
ajnelson-nist Apr 18, 2022
285c61c
Add other CASE and UCO namespaces
ajnelson-nist Apr 18, 2022
b80e33b
Merge pull request #39 from casework/Issue_38
kchason Apr 19, 2022
a170bb1
Add pre-commit and configure hook to review with Black
ajnelson-nist May 3, 2022
0ecd01f
Move Black-based auto-formatting to pre-commit
ajnelson-nist May 3, 2022
63f01d4
Run pre-commit autoupdate
ajnelson-nist May 3, 2022
29077b3
Update NIST license text
ajnelson-nist May 3, 2022
6fbd240
Switch to Apache 2.0 license
kchason May 4, 2022
fbd44ec
Remove notice file
kchason May 4, 2022
89ab0aa
Remove file stub from license
kchason May 4, 2022
16001f6
Merge pull request #47 from casework/update_repository_licensing
kchason May 4, 2022
1312128
Initial build pipeline
kchason May 4, 2022
a9948ed
Add wheel install
kchason May 4, 2022
0171187
Reorder install and remove tag constraints
kchason May 4, 2022
0c8066a
Rename CI file
kchason May 10, 2022
4617cf4
Merge pull request #48 from kchason/pypi-publish
ajnelson-nist May 10, 2022
0dfb21c
Merge branch 'develop' into pre-commit-black
ajnelson-nist May 10, 2022
a085b62
Merge pull request #37 from kchason/pre-commit-black
ajnelson-nist May 10, 2022
b929496
Add debug-logging option to case_file
ajnelson-nist May 11, 2022
68687c2
Update local_uuid configuration, deprecating prior variable
ajnelson-nist May 11, 2022
15ff5e9
Regenerate Make-managed files
ajnelson-nist May 11, 2022
5612134
Change test Python versions to earliest and latest
ajnelson-nist May 11, 2022
417f27c
Change YAML syntax to quoted strings
ajnelson-nist May 11, 2022
3392984
Merge pull request #50 from casework/test_earliest_latest_pythons
kchason May 11, 2022
ca8f4c7
Include all license files in distributions
ajnelson-nist May 11, 2022
e466223
Merge pull request #51 from casework/include_licenses
ajnelson-nist May 11, 2022
2fc740d
Update documentation for PyPI deployment
ajnelson-nist May 11, 2022
710f44e
Merge pull request #52 from casework/make_pypi_documentation
kchason May 11, 2022
83ece60
Merge pull request #49 from casework/change_local_uuid_setup_parameter
kchason May 11, 2022
f2f87f1
Bump versions
ajnelson-nist May 11, 2022
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
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml → .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7, 3.8 ]
python-version: [ '3.7', '3.10' ]

steps:
- uses: actions/checkout@v2
Expand All @@ -35,7 +35,35 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pre-commit Checks
run: |
pip -q install pre-commit
pre-commit run --all-files
- name: Start from clean state
run: make clean
- name: Run tests
run: make PYTHON3=python check

# Build the binary wheel as well as the source tar
- name: Build Objects
run: |
pip install -q twine wheel
python setup.py sdist bdist_wheel

# Ensure the objects were packaged correctly and there wasn't an issue with
# the compilation or packaging process.
- name: Check Objects
run: twine check dist/*

# Upload the packages on all develop and main pipleines for test consumption
- name: Upload HTML Docs
uses: actions/upload-artifact@v2
with:
name: packages
path: ./dist/

# If this commit is the result of a Git tag, push the wheel and tar packages
# to the PyPi registry
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
run: twine upload --repository-url https://upload.pypi.org/legacy/ -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing --verbose dist/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.swp
.DS_Store
.idea/
.venv-pre-commit/
__pycache__
build/
case_utils.egg-info/
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
11 changes: 11 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@ make check
git commit -m "Build CASE 0.6.0 monolithic .ttl files" case_utils/ontology/case-0.6.0-subclasses.ttl case_utils/ontology/case-0.6.0.ttl
git commit -m "Update CASE ontology pointer to version 0.6.0" dependencies/CASE case_utils/ontology/version_info.py
```

This project uses [the `pre-commit` tool](https://pre-commit.com/) for linting The easiest way to install it is with `pip`:
```bash
pip install pre-commit
pre-commit --version
```

The `pre-commit` tool hooks into Git's commit machinery to run a set of linters and static analyzers over each change. To install `pre-commit` into Git's hooks, run:
```bash
pre-commit install
```
199 changes: 176 additions & 23 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,23 +1,176 @@
NIST Software

This software was developed by employees of the National Institute of Standards
and Technology (NIST), an agency of the Federal Government and is being made
available as a public service. Pursuant to title 17 United States Code Section
105, works of NIST employees are not subject to copyright protection in the
United States. This software may be subject to foreign copyright. Permission
in the United States and in foreign countries, to the extent that NIST may hold
copyright, to use, copy, modify, create derivative works, and distribute this
software and its documentation without fee is hereby granted on a non-exclusive
basis, provided that this notice and disclaimer of warranty appears in all copies.

THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED
, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SOFTWARE
WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
A PARTICULAR PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE
DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE SOFTWARE WILL BE
ERROR FREE. IN NO EVENT SHALL NIST BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT
LIMITED TO, DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF,
RESULTING FROM, OR IN ANY WAY CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON
WARRANTY, CONTRACT, TORT, OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS
OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT OF
THE RESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS
29 changes: 27 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ $(error Unable to determine CASE version)
endif

all: \
.ontology.done.log
.ontology.done.log \
.venv-pre-commit/var/.pre-commit-built.log

.PHONY: \
download
Expand Down Expand Up @@ -54,8 +55,32 @@ all: \
test -r case_utils/ontology/case-$(case_version)-subclasses.ttl
touch $@

# This virtual environment is meant to be built once and then persist, even through 'make clean'.
# If a recipe is written to remove this flag file, it should first run `pre-commit uninstall`.
.venv-pre-commit/var/.pre-commit-built.log:
rm -rf .venv-pre-commit
test -r .pre-commit-config.yaml \
|| (echo "ERROR:Makefile:pre-commit is expected to install for this repository, but .pre-commit-config.yaml does not seem to exist." >&2 ; exit 1)
$(PYTHON3) -m venv \
.venv-pre-commit
source .venv-pre-commit/bin/activate \
&& pip install \
--upgrade \
pip \
setuptools \
wheel
source .venv-pre-commit/bin/activate \
&& pip install \
pre-commit
source .venv-pre-commit/bin/activate \
&& pre-commit install
mkdir -p \
.venv-pre-commit/var
touch $@

check: \
.ontology.done.log
.ontology.done.log \
.venv-pre-commit/var/.pre-commit-built.log
$(MAKE) \
PYTHON3=$(PYTHON3) \
--directory tests \
Expand Down
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CASE Python Utilities

This project provides various specialized utilities for producing data in the [CASE](https://caseontology.org/) format.
This project provides various specialized utilities for producing and analyzing data in the [CASE](https://caseontology.org/) format.


## Disclaimer
Expand All @@ -10,12 +10,28 @@ Participation by NIST in the creation of the documentation of mentioned software

## Installation

This repository can be installed from PyPI or from source.


### Installing from PyPI

```bash
pip install case_utils
```

Users who wish to install from PyPI should be aware that while CASE's ontology is in its pre-1.0.0 release state, backwards-incompatible ontology changes may occur. This may manifest as [`case_validate`](#case_validate) reporting data review errors after installing an updated `case_utils` version. Users may wish to pin `case_utils` within any dependent code bases to be less than the next unreleased SEMVER-minor version. (E.g. if `case_utils` version `0.8.0` is currently available, a newly adopting project might wish to track `case_utils<0.9.0` among its dependencies.)


### Installing from source

Users who wish to install pre-release versions and/or make improvements to the code base should install in this manner.

1. Clone this repository.
2. (Optional) Create and activate a virtual environment.
3. (Optional) Upgrade `pip` with `pip install --upgrade pip`. (This can speed installation of some dependent packages.)
4. Run `pip install .`.
4. Run `pip install $x`, where `$x` is the path to the cloned repository.

Installation is demonstrated in the `.venv.done.log` target of the `tests/` directory's [`Makefile`](tests/Makefile).
Local installation is demonstrated in the `.venv.done.log` target of the `tests/` directory's [`Makefile`](tests/Makefile).


## Usage
Expand Down Expand Up @@ -136,3 +152,10 @@ Some `make` targets are defined for this repository:
* `check` - Run unit tests.
* `clean` - Remove test build files, but not downloaded files.
* `download` - Download files sufficiently to run the unit tests offline. This will *not* include the ontology repositories tracked as submodules. Note if you do need to work offline, be aware touching the `setup.cfg` file in the project root directory, or `tests/requirements.txt`, will trigger a virtual environment rebuild.


## Licensing

This repository is licensed under the Apache 2.0 License. See [LICENSE](LICENSE).

Portions of this repository contributed by NIST are governed by the [NIST Software Licensing Statement](THIRD_PARTY_LICENSES.md#nist-software-licensing-statement).
5 changes: 5 additions & 0 deletions README_PyPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CASE Python Utilities

This project provides various specialized utilities for producing and analyzing data in the [CASE](https://caseontology.org/) format.

Full documentation is available at the [project homepage](https://github.com/casework/CASE-Utilities-Python).
Loading