From 6aaa0c5a4e4e80566c378ca173cfa4604c3a6540 Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Wed, 10 Jun 2020 11:36:32 +0200 Subject: [PATCH 1/4] Add CHANGELOG, CONTRIBUTING and notes about releases --- CHANGELOG.md | 29 +++++++++++++++++++++++++++ CONTRIBUTING.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 10 ++++++++++ sruthi/__init__.py | 8 +++++--- 4 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..95443b0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog +All notable changes to this project will be documented in this file. +The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project follows [Semantic Versioning](http://semver.org/). + +## [Unreleased][unreleased] +### Added +- Support for explain operation +- Response classes +- Tests for the existing functionality +- `maximum_records` parameter for Client +- Example scripts in the `examples` directory + +### Changed +- XMLParser is now a class, so that XML namespaces can be changed on-the-fly + +## 0.0.1 - 2020-05-23 +### Added +- Initial release of sruthi +- basic support for searchretrieve operation + + + +# Categories +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for once-stable features removed in upcoming releases. +- `Removed` for deprecated features removed in this release. +- `Fixed` for any bug fixes. +- `Security` to invite users to upgrade in case of vulnerabilities. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d5589b7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Contributing + +If you want to participate in this project, please follow this guidline. + +Fork and clone this repository: + +```bash +git clone git@github.com:your-username/sruthi.git +``` + +Install the dependencies using `pip`: + +```bash +pip install -r requirements.txt +pip install -r test-requirements.txt +``` + +Make sure the tests pass: + +```bash +pytest +``` + +To ensure a good quality of the code use `flake8` to check the code style: + +```bash +flake8 --install-hook git +``` + +## Create a pull request + +1. Choose the `develop` branch as a target for new/changed functionality, `master` should only be targeted for urgent bugfixes. +2. While it's not strictly required, it's highly recommended to create a new branch on your fork for each pull request. +3. Push to your fork and [submit a pull request][pr]. +4. Check if the [build ran successfully][ci] and try to improve your code if not. + +At this point you're waiting for my review. +I might suggest some changes or improvements or alternatives. + +Some things that will increase the chance that your pull request is accepted: + +* Write tests. +* Follow the Python style guide ([PEP-8][pep8]). +* Write a [good commit message][commit]. + +[pr]: https://github.com/metaodi/sruthi/compare/ +[ci]: https://github.com/metaodi/sruthi/actions +[pep8]: https://www.python.org/dev/peps/pep-0008/ +[commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html diff --git a/README.md b/README.md index 69d28a0..b044761 100644 --- a/README.md +++ b/README.md @@ -82,3 +82,13 @@ sruthi has been tested with the following schemas: * [Dublin Core Record Schema](http://www.loc.gov/standards/sru/recordSchemas/dc-schema.html) (dc) * [MARCXML: The MARC 21 XML Schema](http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd) (marcxml) * [ISAD(G): General International Standard Archival Description, Second edition](http://www.expertisecentrumdavid.be/xmlschemas/isad.xsd) (isad) + +## Release + +To create a new release, follow these steps (please respect [Semantic Versioning](http://semver.org/)): + +1. Adapt the version number in `sruthi/__init__.py` +1. Update the CHANGELOG with the version +1. Create a pull request to merge `develop` into `master` (make sure the tests pass!) +1. Create a [new release/tag on GitHub](https://github.com/metaodi/sruthi/releases) (on the master branch) +1. The [publication on PyPI](https://pypi.python.org/pypi/sruthi) happens via [GitHub Actions](https://github.com/metaodi/sruthi/actions?query=workflow%3A%22Upload+Python+Package%22) on every tagged commit diff --git a/sruthi/__init__.py b/sruthi/__init__.py index b3b6d6c..3d7a4e0 100644 --- a/sruthi/__init__.py +++ b/sruthi/__init__.py @@ -1,5 +1,7 @@ __version__ = '0.0.1' +__all__ = ['errors', 'sru', 'client'] -from .errors import (SruthiError, ServerIncompatibleError, SruError, NoMoreRecordsError) # noqa -from .sru import searchretrieve, explain # noqa -from .client import Client # noqa +from sruthi.errors import SruthiError, ServerIncompatibleError, SruError, NoMoreRecordsError +from sruthi.errors import SruthiWarning, WrongNamespaceWarning +from sruthi.sru import searchretrieve, explain +from sruthi.client import Client From 8e4c3983882b07670a2a04d46ffbe332a85559dd Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Wed, 10 Jun 2020 11:42:11 +0200 Subject: [PATCH 2/4] Update links in CHANGELOG --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95443b0..13ed58e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project follows [Semantic Versioning](http://semver.org/). -## [Unreleased][unreleased] +## [Unreleased] ### Added - Support for explain operation - Response classes @@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Changed - XMLParser is now a class, so that XML namespaces can be changed on-the-fly -## 0.0.1 - 2020-05-23 +## [0.0.1] - 2020-05-23 ### Added - Initial release of sruthi - basic support for searchretrieve operation @@ -27,3 +27,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - `Removed` for deprecated features removed in this release. - `Fixed` for any bug fixes. - `Security` to invite users to upgrade in case of vulnerabilities. + +[Unreleased]: https://github.com/metaodi/sruthi/compare/v0.0.1...HEAD +[0.0.2]: https://github.com/metaodi/sruthi/compare/v0.0.1...v0.0.2 +[0.0.1]: https://github.com/metaodi/sruthi/releases/tag/v0.0.1 From fc5b3544e557a8f073962d551ce8ae6a97252955 Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Wed, 10 Jun 2020 11:44:36 +0200 Subject: [PATCH 3/4] Fix imports --- sruthi/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sruthi/__init__.py b/sruthi/__init__.py index 3d7a4e0..d4837ec 100644 --- a/sruthi/__init__.py +++ b/sruthi/__init__.py @@ -1,7 +1,7 @@ __version__ = '0.0.1' __all__ = ['errors', 'sru', 'client'] -from sruthi.errors import SruthiError, ServerIncompatibleError, SruError, NoMoreRecordsError -from sruthi.errors import SruthiWarning, WrongNamespaceWarning -from sruthi.sru import searchretrieve, explain -from sruthi.client import Client +from .errors import SruthiError, ServerIncompatibleError, SruError, NoMoreRecordsError # noqa +from .errors import SruthiWarning, WrongNamespaceWarning # noqa +from .sru import searchretrieve, explain # noqa +from .client import Client # noqa From eafe0cc4a3c6e91c3468e268a23a900d6834d5c7 Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Wed, 10 Jun 2020 13:37:53 +0200 Subject: [PATCH 4/4] Release 0.0.2 --- CHANGELOG.md | 5 ++++- sruthi/__init__.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13ed58e..980b7bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project follows [Semantic Versioning](http://semver.org/). ## [Unreleased] + +## [0.0.2] - 2020-06-10 ### Added - Support for explain operation - Response classes - Tests for the existing functionality - `maximum_records` parameter for Client - Example scripts in the `examples` directory +- CHANGELOG.md and CONTRIBUTING.md ### Changed - XMLParser is now a class, so that XML namespaces can be changed on-the-fly @@ -28,6 +31,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - `Fixed` for any bug fixes. - `Security` to invite users to upgrade in case of vulnerabilities. -[Unreleased]: https://github.com/metaodi/sruthi/compare/v0.0.1...HEAD +[Unreleased]: https://github.com/metaodi/sruthi/compare/v0.0.2...HEAD [0.0.2]: https://github.com/metaodi/sruthi/compare/v0.0.1...v0.0.2 [0.0.1]: https://github.com/metaodi/sruthi/releases/tag/v0.0.1 diff --git a/sruthi/__init__.py b/sruthi/__init__.py index d4837ec..a75337b 100644 --- a/sruthi/__init__.py +++ b/sruthi/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.0.1' +__version__ = '0.0.2' __all__ = ['errors', 'sru', 'client'] from .errors import SruthiError, ServerIncompatibleError, SruError, NoMoreRecordsError # noqa