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

biannual updates #51

Merged
merged 3 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:

backend:
name: lint + test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v1
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Python RIS files parser and reader
.. image:: https://badge.fury.io/py/rispy.svg
:target: https://badge.fury.io/py/rispy

A Python 3.6+ reader/writer of RIS reference files.
A Python 3.8+ reader/writer of RIS reference files.

Usage
-----
Expand Down Expand Up @@ -57,7 +57,7 @@ Writing:
>>> filepath = 'export.ris'
>>> with open(filepath, 'w') as bibliography_file:
... rispy.dump(entries, bibliography_file)


Example RIS entry
-----------------
Expand Down Expand Up @@ -252,7 +252,7 @@ Custom parsers can inherit ``RisParser`` (the default parser) or ``BaseParser``.
Examples:

.. code:: python

class WokParser(BaseParser):
"""Subclass of Base for reading Wok RIS files."""

Expand Down Expand Up @@ -324,15 +324,15 @@ Common developer commands are in the provided `Makefile`; if you don't have `mak
# setup environment
python -m venv venv
source venv/bin/activate
pip install -e .[dev,test]
pip install -e ".[dev,test]"

# check if code format changes are required
make lint

# reformat code
make format

# run tests
make test
make test

Github Actions are currently enabled to run `lint` and `test` when submitting a pull-request.
4 changes: 0 additions & 4 deletions rispy/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def __init__(
self.enforce_list_tags = enforce_list_tags

def _get_reference_type(self, ref):

if "type_of_reference" in ref.keys():
# TODO add check
return ref["type_of_reference"]
Expand All @@ -93,7 +92,6 @@ def _format_line(self, tag, value=""):
return self.PATTERN.format(tag=tag, value=value)

def _format_reference(self, ref, count):

lines = []

header = self.set_header(count)
Expand All @@ -106,7 +104,6 @@ def _format_reference(self, ref, count):
tags_to_skip.append("UK")

for label, value in ref.items():

# not available
try:
tag = self._rev_mapping[label.lower()]
Expand All @@ -133,7 +130,6 @@ def _format_reference(self, ref, count):
return lines

def _format_all_references(self, references):

for i, ref in enumerate(references):
lines_ref = self._format_reference(ref, count=i + 1)
for line in lines_ref:
Expand Down
8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ classifiers =
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11

[options]
python_requires = >=3.6
python_requires = >=3.8
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering why this is needed. As things seem to work properly for 3.6.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

python 3.6 is EOL and we no longer have tests to support, 3.7 is EOL in 2 weeks, so bumped it to 3.8

Copy link
Collaborator Author

@shapiromatron shapiromatron Jun 9, 2023

Choose a reason for hiding this comment

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

packages = find:

[options.packages.find]
exclude = contrib; docs; tests*

[options.extras_require]
dev = black==21.5b1; flake8==3.7.9; check-manifest; wheel
dev = black==23.3.0; flake8==6.0.0; check-manifest; wheel
test = coverage; pytest
1 change: 0 additions & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def test_load_example_extraneous_data_ris():


def test_load_example_full_ris_without_whitespace():

# Parse files without whitespace after ER tag.
# Resolves https://github.com/MrTango/rispy/pull/25

Expand Down
1 change: 0 additions & 1 deletion tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def test_dump_and_load():


def test_dumps_multiple_unknown_tags_ris(tmp_path):

fp = tmp_path / "test_dump_unknown_tags.ris"

results = [{"title": "my-title", "abstract": "my-abstract", "does_not_exists": "test"}]
Expand Down
Loading