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 1 commit
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
Next Next commit
update black
  • Loading branch information
shapiromatron committed Jun 7, 2023
commit f7132ac54dd736396d5fd8977b2007f8dd36dead
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ 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