Skip to content

DataTypes in Libdoc Specs - #3743

Merged
pekkaklarck merged 15 commits into
masterfrom
topic/libdoc_datatypes
Nov 30, 2020
Merged

pekkaklarck merged 15 commits into
masterfrom
topic/libdoc_datatypes

Conversation

@Snooz82

@Snooz82 Snooz82 commented Oct 28, 2020

Copy link
Copy Markdown
Member

No description provided.

@Snooz82
Snooz82 force-pushed the topic/libdoc_datatypes branch from e5a68dd to 699a7ed Compare October 30, 2020 15:49
@mkorpela
mkorpela force-pushed the topic/libdoc_datatypes branch from 1178595 to b43e57b Compare November 9, 2020 15:18
@Snooz82
Snooz82 force-pushed the topic/libdoc_datatypes branch 2 times, most recently from 56b5908 to 1842479 Compare November 16, 2020 21:13
@Snooz82
Snooz82 requested a review from pekkaklarck November 17, 2020 16:12
@Snooz82
Snooz82 marked this pull request as ready for review November 17, 2020 16:13
@Snooz82
Snooz82 force-pushed the topic/libdoc_datatypes branch from 36bfcfe to b4ba177 Compare November 17, 2020 17:01
Comment thread src/robot/libdocpkg/xmlwriter.py Resolved
Comment thread src/robot/libdocpkg/xmlwriter.py Resolved
Comment thread src/robot/libdocpkg/specbuilder.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/model.py Resolved
Comment thread src/robot/libdocpkg/specbuilder.py Resolved
Comment thread src/robot/libdocpkg/specbuilder.py Resolved
Comment thread src/robot/libdocpkg/xmlwriter.py Resolved
@Snooz82
Snooz82 force-pushed the topic/libdoc_datatypes branch 2 times, most recently from 896ed4c to 594b4e0 Compare November 19, 2020 14:59
@mkorpela
mkorpela force-pushed the topic/libdoc_datatypes branch from e076b8c to ceafc4b Compare November 24, 2020 11:02
@Snooz82
Snooz82 force-pushed the topic/libdoc_datatypes branch from ceafc4b to e7681ca Compare November 25, 2020 17:55
@codecov-io

codecov-io commented Nov 25, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #3743 (c9c84c9) into master (e278452) will increase coverage by 0.03%.
The diff coverage is 75.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3743      +/-   ##
==========================================
+ Coverage   74.43%   74.45%   +0.03%     
==========================================
  Files         216      217       +1     
  Lines       17759    17930     +171     
  Branches     2884     2915      +31     
==========================================
+ Hits        13217    13348     +131     
- Misses       4049     4082      +33     
- Partials      493      500       +7     
Impacted Files Coverage Δ
src/robot/libdocpkg/xmlwriter.py 58.66% <12.91%> (-19.42%) ⬇️
src/robot/libdocpkg/htmlutils.py 85.90% <60.00%> (-2.26%) ⬇️
src/robot/libdocpkg/model.py 85.92% <75.00%> (-4.34%) ⬇️
src/robot/libdocpkg/specbuilder.py 85.00% <93.75%> (+12.28%) ⬆️
src/robot/libdocpkg/datatypesdoc.py 94.51% <94.51%> (ø)
src/robot/libdocpkg/jsonbuilder.py 94.74% <100.00%> (+0.30%) ⬆️
src/robot/running/arguments/argumentspec.py 96.48% <100.00%> (+1.41%) ⬆️
src/robot/version.py 55.56% <0.00%> (-11.11%) ⬇️
src/robot/running/testlibraries.py 77.75% <0.00%> (-1.25%) ⬇️
src/robot/utils/importer.py 84.62% <0.00%> (-1.02%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e278452...c9c84c9. Read the comment docs.

@Snooz82
Snooz82 force-pushed the topic/libdoc_datatypes branch from 7facd50 to 937339f Compare November 29, 2020 21:27

from robot.api import logger
from robot.utils import CONSOLE_ENCODING, SYSTEM_ENCODING, unicode
from robot.utils import PY_VERSION, CONSOLE_ENCODING, SYSTEM_ENCODING, unicode

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unused import.

ExtTypedDictType = type(ExtTypedDict('TypedDictDummy', {}))
except ImportError:
class ExtTypedDictType(object):
pass

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these imports needed anymore? If they are, couldn't they be imported from the new datatypesdoc module?

'type': item.get('type'),
'required': required})
return TypedDictDoc(name=dt.get('name'),
type='TypedDict',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needing to pass TypedDict as type explicitly is somewhat strange. Couldn't that be de default with TypedDictDoct?

from typing_extensions import TypedDict
return True
except ImportError:
return PY_VERSION[0] == 3 and PY_VERSION[1] >= 9

@pekkaklarck pekkaklarck Nov 30, 2020 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be named something like is_typeddict_supported?


def test_DataTypesLibrary_py(self):
if PY_VERSION[0] == 3 and PY_VERSION[1] >= 7:
run_libdoc_and_validate_json('DataTypesLibrary.py')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd prefer creating the test only when it's applicable and comparing version as a tuple:

if PY_VERSION > (3, 7):
    def test_DataTypesLibrary_py(self):
        ...

@pekkaklarck
pekkaklarck merged commit 76654eb into master Nov 30, 2020
@@ -1 +1,2 @@
xmlschema
typing-extensions; python_version == '3.7'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be in atest/requirements.txt or in utest/requirements.txt that's read by the former, not here.

@pekkaklarck

Copy link
Copy Markdown
Member

Fixed problems mentioned in above comments in 50788fd.

@pekkaklarck
pekkaklarck deleted the topic/libdoc_datatypes branch November 30, 2020 11:18
vokiput pushed a commit to vokiput/robotframework that referenced this pull request Dec 27, 2020
Add them to specs (robotframework#3607) and show in HTML (robotframework#3783).

Few things still to be fixed. See PR robotframework#3743 for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants