Skip to content

Upgrades and fix ignored class thing #181

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

Merged
merged 3 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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 robotpy_build/templates/cls.cpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct rpybuild_{{ mod_fn }}_initializer {
enum{{ loop.index }}{{ pybind11.enum_def(enum.x_module_var, enum) }}
{% endfor %}

{% for cls in header.classes %}
{% for cls in header.classes if not cls.data.ignore %}
{{ pybind11.cls_def_enum(cls, cls.x_varname) }}
{% endfor %}
}
Expand Down
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development

[options]
Expand All @@ -26,8 +28,8 @@ install_requires =
# pep 660 editable install implementation in setuptools 64+ break my workflow
setuptools >= 45, < 64
setuptools_scm >= 6.2
header2whatever >= 0.4.7
robotpy-cppheaderparser >= 5.0.20
header2whatever >= 0.4.8
robotpy-cppheaderparser >= 5.1
sphinxify >= 0.7.3
pydantic >= 1.7.0
tomli
Expand Down
2 changes: 2 additions & 0 deletions tests/cpp/gen/ft/ignore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ functions:
classes:
IgnoredClass:
ignore: true
IgnoredClassWithEnum:
ignore: true
ClassWithIgnored:
attributes:
ignoredProp:
Expand Down
4 changes: 4 additions & 0 deletions tests/cpp/rpytest/ft/include/ignore.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ int fnIgnoredParam(int x) { return x; }
// class
struct IgnoredClass {};

struct IgnoredClassWithEnum {
enum AlsoIgnored { Value = 1 };
};

struct ClassWithIgnored {

// class function
Expand Down
1 change: 1 addition & 0 deletions tests/test_ft_ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def test_ignore_fn():

def test_ignore_cls():
assert not hasattr(ft._rpytest_ft, "IgnoredClass")
assert not hasattr(ft._rpytest_ft, "IgnoredClassWithEnum")

c = ft.ClassWithIgnored()

Expand Down