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

Switch to GitHub actions and cleanup syntax/API use #48

Merged
merged 2 commits into from
Jul 12, 2024
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
2 changes: 1 addition & 1 deletion Default/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Which class names to map to resources and elements
classmap = {
'Any': 'Resource',
'Practitioner.role': 'PractRole', # to avoid Practinioner.role and PractitionerRole generating the same class
'Practitioner.role': 'PractRole', # to avoid Practitioner.role and PractitionerRole generating the same class

'boolean': 'bool',
'integer': 'int',
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ If you've come here because you want _Swift_ or _Python_ classes for FHIR data m
- [Swift-FHIR][] and [Swift-SMART][]
- Python [client-py][]

The `master` branch is currently capable of parsing _STU 3, v3.0.0_.
The `develop` branch should be capable of parsing the continuous integration build and will be merged into master on new major FHIR releases.
There may be tags for specific freezes, see [releases](https://github.com/smart-on-fhir/fhir-parser/releases).
The `master` branch is currently capable of parsing _R5_.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The develop branch is strictly 14 commits behind master currently - folks seem to have switched to trunk-based dev (which seems fine, since it's currently backwards compatible).

I took out the link to releases because (a) there are no release, just tags and (b) even the tags aren't very up to date - just a bunch of 1.x stuff from early days.


This work is licensed under the [APACHE license][license].
FHIR® is the registered trademark of [HL7][] and is used with the permission of HL7.
Expand Down
8 changes: 4 additions & 4 deletions fhirrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import textwrap

from jinja2 import Environment, PackageLoader, TemplateNotFound
from jinja2.filters import environmentfilter
from jinja2.filters import pass_environment
from logger import logger


Expand Down Expand Up @@ -202,7 +202,7 @@ def render(self):
# ignores existing linebreaks when applying the wrap:
# https://github.com/mitsuhiko/jinja2/issues/175
# Here's the workaround:
@environmentfilter
@pass_environment
def do_wordwrap(environment, s, width=79, break_long_words=True, wrapstring=None):
"""
Return a copy of the string passed to the filter wrapped after
Expand All @@ -211,7 +211,7 @@ def do_wordwrap(environment, s, width=79, break_long_words=True, wrapstring=None
split words apart if they are longer than `width`.
"""
if not s:
return s
return s

if not wrapstring:
wrapstring = environment.newline_sequence
Expand All @@ -220,7 +220,7 @@ def do_wordwrap(environment, s, width=79, break_long_words=True, wrapstring=None
# Workaround: pre-split the string on \r, \r\n and \n
for component in re.split(r"\r\n|\n|\r", s):
# textwrap will eat empty strings for breakfirst. Therefore we route them around it.
if len(component) is 0:
if len(component) == 0:
accumulator.append(component)
continue
accumulator.extend(
Expand Down
2 changes: 1 addition & 1 deletion fhirspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def needed_external_classes(self):
raise Exception('There is no class "{}" for property "{}" on "{}" in {}'.format(prop_cls_name, prop.name, klass.name, self.name))
else:
prop.module_name = prop_cls.module
if not prop_cls_name in needed:
if prop_cls_name not in needed:
needed.add(prop_cls_name)
needs.append(prop_cls)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jinja2>=2.9.5
Jinja2>=3.0
MarkupSafe==0.23
requests>=2.13.0
colorlog==2.10.0