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

Better property support #640

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
bd7ca7b
Initial attempt at fixing #587: Unify properties getter, setters and …
tristanlatr Aug 5, 2022
5758a37
More property demo
tristanlatr Aug 5, 2022
eb8f49e
Fix test
tristanlatr Aug 5, 2022
51935e6
Better understanding properties
tristanlatr Aug 11, 2022
11ac561
fix test
tristanlatr Aug 11, 2022
4c812ac
More tests
tristanlatr Aug 12, 2022
6935be1
Don't use list() to create a list of attribute to initiate.
tristanlatr Aug 12, 2022
32554af
Better checks before adding new inherited elements to property
tristanlatr Aug 12, 2022
b3c6d01
Add overriden properties to the RST demo.
tristanlatr Aug 16, 2022
643069a
Merge branch 'master' into 587-better-property-support
tristanlatr Sep 8, 2022
4fb19c2
fix import
tristanlatr Nov 18, 2022
a3f2519
add assert
tristanlatr Nov 18, 2022
96fd437
Merge branch 'master' into 587-better-property-support
tristanlatr Nov 18, 2022
bdd449f
fix mypy
tristanlatr Nov 18, 2022
67ec358
simplify the code a little bit
tristanlatr Nov 18, 2022
dbf0477
simplify again
tristanlatr Nov 18, 2022
e7c73a5
Simplify again, no need to tell the users the property is read-write …
tristanlatr Nov 18, 2022
d084224
Simplify more
tristanlatr Nov 18, 2022
111b669
remove commented code
tristanlatr Nov 19, 2022
991d0a4
Try to simplify more
tristanlatr Nov 19, 2022
b6ab83d
Refactors
tristanlatr Nov 19, 2022
6cbb8a8
Merge branch 'master' into 587-better-property-support
tristanlatr Feb 1, 2023
d058d43
Merge branch 'master' into 587-better-property-support
tristanlatr Apr 6, 2023
d3d5d51
Simplify
tristanlatr Apr 6, 2023
346b40d
Use impossible import cycle in test
tristanlatr Apr 6, 2023
063ded2
Minor refactor
tristanlatr Apr 6, 2023
9dccd4f
Minor refactors
tristanlatr Apr 6, 2023
49eca75
Merge branch 'master' into 587-better-property-support
tristanlatr Apr 6, 2023
a1529ee
Fix import
tristanlatr Apr 6, 2023
6203a04
Fix mypy
tristanlatr Apr 6, 2023
272e7db
Fix crash :/
tristanlatr Apr 6, 2023
88cb433
Fix pyflakes
tristanlatr Apr 6, 2023
5acd371
Create a legit model object for Properties.
tristanlatr Apr 7, 2023
ceacac0
Refoctors to have a more simple model.
tristanlatr Apr 7, 2023
91c34bf
Minor comment
tristanlatr Apr 7, 2023
a45ebe2
Add Property model to the extension system.
tristanlatr Apr 23, 2023
ff6a662
Simplify implementation
tristanlatr Apr 23, 2023
2532a06
Simplify propertyInfo renderer
tristanlatr Apr 23, 2023
f2632a7
add missing PropertyMixin to mixinT
tristanlatr Apr 23, 2023
4383240
Refacfors
tristanlatr Apr 24, 2023
21a047a
Update docs/epytext_demo/demo_epytext_module.py
tristanlatr Jun 4, 2023
4f6b591
Update docs/restructuredtext_demo/demo_restructuredtext_module.py
tristanlatr Jun 4, 2023
91afd5b
Merge branch '587-better-property-support' of github.com:twisted/pydo…
tristanlatr Jun 4, 2023
3eed08a
Merge branch 'master' into 587-better-property-support
tristanlatr Jun 4, 2023
de67845
Remove inherited property support. Add support for old school property()
tristanlatr Jun 5, 2023
4b8a0ff
Avoid calling 'signature(property)', it fails on some python versions.
tristanlatr Jun 5, 2023
c635451
Trigger warnings when a docstring is beeing overriden.
tristanlatr Jun 5, 2023
198f91d
Fix mypy and few refactors
tristanlatr Jun 5, 2023
d2e143b
Typo
tristanlatr Jun 5, 2023
4e174e2
Merge branch 'master' into 587-better-property-support
tristanlatr Sep 10, 2023
917947a
Merge branch 'master' into 587-better-property-support
tristanlatr Sep 12, 2023
ef4c7c0
Merge branch 'master' into 587-better-property-support
tristanlatr Sep 28, 2023
e6b9bef
Merge branch 'master' into 587-better-property-support
tristanlatr Sep 28, 2023
bd73b7e
Merge branch 'master' into 587-better-property-support
tristanlatr Nov 3, 2023
ac52177
Merge branch 'master' into 587-better-property-support
tristanlatr Jan 17, 2024
d7bdff5
Re-add support for inherited property support.
tristanlatr Jan 17, 2024
5f2f3ee
Merge branch 'master' into 587-better-property-support
tristanlatr Jan 18, 2024
af08b4b
Fix pyflakes
tristanlatr Jan 18, 2024
f088646
Merge branch '587-better-property-support' of github.com:twisted/pydo…
tristanlatr Jan 18, 2024
58c941b
Minor refactors
tristanlatr Jan 18, 2024
1bb7bed
Make sure we don't remove property functions when the property is cre…
tristanlatr Jan 21, 2024
238f386
Merge branch 'master' into 587-better-property-support
tristanlatr Jun 20, 2024
dec3483
Factor out some logic of the function def handler that is becoming to…
tristanlatr Jun 21, 2024
323e59d
Merge branch 'master' into 587-better-property-support
tristanlatr Jul 4, 2024
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
13 changes: 11 additions & 2 deletions docs/epytext_demo/demo_epytext_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,14 @@ def read_and_write(self) -> int:
@read_and_write.setter
def read_and_write(self, value: int) -> None:
"""
This is a docstring for setter.
This is a docstring for setter.
Their are usually not explicitely documented though.
"""

@property
def read_and_write_delete(self) -> int:
"""
This is a read-write-delete property.
This is the docstring of the property.
"""
return 1

Expand All @@ -183,6 +184,14 @@ def read_and_write_delete(self) -> None:
"""
This is a docstring for deleter.
"""

@property
def undoc_prop(self) -> bytes:
"""This property has a docstring only on the getter."""
return b''
@undoc_prop.setter
def undoc_prop(self, p) -> None: # type:ignore
...


class IContact(zope.interface.Interface):
Expand Down
36 changes: 34 additions & 2 deletions docs/restructuredtext_demo/demo_restructuredtext_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ def _private_inside_private(self) -> List[str]:
:rtype: `list`
"""
return []

@property
def isPrivate(self) -> bool:
"""Whether this class is private"""
return True
@isPrivate.setter
def isPrivate(self, v) -> bool:
raise NotImplemented()

@property
def isPublic(self) -> bool:
"""Whether this class is public"""
return False
@isPublic.setter
def isPublic(self, v) -> bool:
raise NotImplemented()



Expand Down Expand Up @@ -178,13 +194,14 @@ def read_and_write(self) -> int:
@read_and_write.setter
def read_and_write(self, value: int) -> None:
"""
This is a docstring for setter.
This is a docstring for setter.
Their are usually not explicitely documented though.
"""

@property
def read_and_write_delete(self) -> int:
"""
This is a read-write-delete property.
This is the docstring of the property.
"""
return 1

Expand All @@ -199,6 +216,21 @@ def read_and_write_delete(self) -> None:
"""
This is a docstring for deleter.
"""

@property
def undoc_prop(self) -> bytes:
"""This property has a docstring only on the getter."""
@undoc_prop.setter
def undoc_prop(self, p) -> None: # type:ignore
...

@property
def isPrivate(self) -> bool:
return False

@_PrivateClass.isPublic.setter
def isPublic(self, v):
self._v = v

class IContact(zope.interface.Interface):
"""
Expand Down
2 changes: 1 addition & 1 deletion docs/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_search(query:str, expected:List[str], order_is_important:bool=True) ->
['pydoctor.model.Class',
'pydoctor.factory.Factory.Class',
'pydoctor.model.DocumentableKind.CLASS',
'pydoctor.model.System.Class'])
'pydoctor.model.System.Class'], order_is_important=False)

to_stan_results = [
'pydoctor.epydoc.markup.ParsedDocstring.to_stan',
Expand Down
Loading
Loading