Martian

Latest version: v2.0.post1

Safety actively analyzes 701563 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

0.9.5

==================

* ``scan_for_classes`` just needs a single second argument specifying
an interface. The support for scanning for subclasses directly has
been removed as it became unnecessary (due to changes in
grokcore.component).

0.9.4

==================

Features changes
----------------

* Replaced the various directive base classes with a single
``martian.Directive`` base class:

- The directive scope is now defined with the ``scope`` class
attribute using one of ``martian.CLASS``, ``martian.MODULE``,
``martian.CLASS_OR_MODULE``.

- The type of storage is defined with the ``store`` class attribute
using one of ``martian.ONCE``, ``martian.MULTIPLE``,
``martian.DICT``.

- Directives have now gained the ability to read the value that they
have set on a component or module using a ``get()`` method. The
``class_annotation`` and ``class_annotation_list`` helpers have
been removed as a consequence.

* Moved the ``baseclass()`` directive from Grok to Martian.

* Added a ``martian.util.check_provides_one`` helper, in analogy to
``check_implements_one``.

* The ``scan_for_classes`` helper now also accepts an ``interface``
argument which allows you to scan for classes based on interface
rather than base classes.

Bug fixes
---------

* added dummy ``package_dotted_name`` to ``BuiltinModuleInfo``. This
allows the grokking of views in test code using Grok's
``grok.testing.grok_component`` without a failure when it sets up the
``static`` attribute.

* no longer use the convention that classes ending in -Base will be considered
base classes. You must now explicitly use the grok.baseclass() directive.

* The type check of classes uses isinstance() instead of type(). This means
Grok can work with Zope 2 ExtensionClasses and metaclass programming.

0.9.3

==================

Feature changes
---------------

* Added an OptionalValueDirective which allows the construction of
directives that take either zero or one argument. If no arguments
are given, the ``default_value`` method on the directive is
called. Subclasses need to override this to return the default value
to use.

Restructuring
-------------

* Move some util functions that were really grok-specific out of Martian
back into Grok.

0.9.2

==================

Bug fixes
---------

* scan.module_info_from_dotted_name() now has special behavior when it
runs into __builtin__. Previously, it would crash with an error. Now
it will return an instance of BuiltinModuleInfo. This is a very
simple implementation which provides just enough information to make
client code work. Typically this client code is test-related so that
the module context will be __builtin__.

0.9.1

==================

Feature changes
---------------

* Grokkers now receive a ``module_info`` keyword argument. This
change is completely backwards-compatible since grokkers which don't
take ``module_info`` explicitly will absorb the extra argument in
``**kw``.

0.9

=================

Feature changes
---------------

* Reverted the behaviour where modules called tests or ftests were skipped
by default and added an API to provides a filtering function for skipping
modules to be grokked.

Page 4 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.