Skip to content

Commit

Permalink
Bump to version 0.16.0 (#162)
Browse files Browse the repository at this point in the history
* Prepare for new release

* Try to add publish release to github
  • Loading branch information
joeced authored Mar 15, 2023
1 parent bbc8c50 commit 0af7b19
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
files: |
sdist
bdist_wheel
9 changes: 8 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
sphinxcontrib-matlabdomain-0.16.0 (2023-03-15)
==============================================

* Add new option, ``matlab_show_property_default_value``. Default is now to not
show property values. If a property value is ``None``, is not shown anymore.


sphinxcontrib-matlabdomain-0.15.2 (2023-03-14)
==============================================

Expand Down Expand Up @@ -425,4 +432,4 @@ sphinxcontrib-matlabdomain-0.1 (2013-04-25)
* create a Sphinx domain for MATLAB
* override standard domain to remove py modules index
.. _`deprecated Sphinx API`: https://www.sphinx-doc.org/en/master/extdev/deprecated.html
.. _`deprecated Sphinx API`: https://www.sphinx-doc.org/en/master/extdev/deprecated.html
30 changes: 15 additions & 15 deletions sphinxcontrib/mat_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def matlabify(objname):
objname = objname.replace(".", os.sep) # objname may have dots
# separate path from file/folder name
path, name = os.path.split(objname)

# make a full path out of basedir and objname
fullpath = os.path.join(MatObject.basedir, objname) # objname fullpath
# package folders imported over mfile with same name
Expand Down Expand Up @@ -708,10 +709,8 @@ def __init__(self, name, modname, tokens):
except IndexError:
break
docstring = wht # check if Token is Comment
# =====================================================================
# Is this code even used?
# main body
# find Keywords - "end" pairs

# Find the end of the function - used in `MatMethod`` to determine where a method ends.
if docstring is None:
return
kw = docstring # last token
Expand Down Expand Up @@ -986,9 +985,7 @@ def __init__(self, name, modname, tokens):
continue

# subtype of Name EG Name.Builtin used as Name
elif (
self.tokens[idx][0] in Token.Name.subtypes
): # @UndefinedVariable
elif self.tokens[idx][0] in Token.Name.subtypes:
prop_name = self.tokens[idx][1]
warn_msg = " ".join(
["[%s] WARNING %s.%s.%s is", "a Builtin Name"]
Expand Down Expand Up @@ -1151,14 +1148,16 @@ def __init__(self, name, modname, tokens):
meth = MatMethod(
self.module, self.tokens[idx:], self, attr_dict
)
# Detect getter/setter methods - these are not documented
if not (
meth.name.startswith("get.")
or meth.name.startswith("set.")
):
self.methods[meth.name] = meth # update methods
idx += meth.reset_tokens() # reset method tokens and index

# Detect getter/setter methods - these are not documented
isGetter = meth.name.startswith("get.")
isSetter = meth.name.startswith("set.")
if not (isGetter or isSetter):
# Add the parsed method to methods dictionary
self.methods[meth.name] = meth

# Update idx with the number of parsed tokens.
idx += meth.skip_tokens()
idx += self._whitespace(idx)
idx += 1
if self._tk_eq(idx, (Token.Keyword, "events")):
Expand Down Expand Up @@ -1377,7 +1376,8 @@ def __init__(self, modname, tks, cls, attrs):
self.cls = cls
self.attrs = attrs

def reset_tokens(self):
def skip_tokens(self):
# Number of tokens to skip in `MatClass`
num_rem_tks = len(self.rem_tks)
len_meth = len(self.tokens) - num_rem_tks
self.tokens = self.tokens[:-num_rem_tks]
Expand Down

0 comments on commit 0af7b19

Please sign in to comment.