Skip to main content

This package adds a new ZCML directive: “autoinclude”. This directive searches through the dependencies in your setup.py file (install_requires), and includes the meta.zcml and configure.zcml files in those packages that it finds. Inclusion order matches the order in the setup.py file. You can pass a path for the package you want to autoinclude for, but typically you pass in the current package, as follows:

<autoinclude package="." />

The motivation behind this is to prevent having to repeat yourself in two places when you want to depend on a Zope 3 or Grok-based dependency: in the setup.py (in install_requires) to make the dependency known, and again in configure.zcml with an include statement to make sure the dependency’s ZCML file are included. Because you have to repeat yourself, you can easily make an error where you add a new dependency in setup.py, but forget to include the ZCML as well. If your package uses the autoinclude directive, adding the includes for the ZCML configuration of individual dependencies is no longer necessary.

The next versions of Grok and grokproject will use this functionality out of the box. The grokproject command will automatically add the autoinclude directive in the ZCML of the project it generates. You can then stop worrying about manual ZCML inclusion in the vast majority of cases.

The autoinclude directive automatically includes configure.zcml and meta.zcml files that in the main package directories. In some cases, a package may use unusual names or locations for its ZCML files. In that case you will need to modify your package’s configure.zcml and meta.zcml yourself to include the ZCML using the manual include directive.

To make the autoinclude directive available for use in your application or framework, you need to include it (in your meta.zcml for instance), like this:

<include package="z3c.autoinclude" file="meta.zcml" />

Grok already does this for you automatically.

Changes

0.1 (2008-02-25)

  • Initial public release.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z3c.autoinclude-0.1.tar.gz (9.3 kB view details)

Uploaded Source

File details

Details for the file z3c.autoinclude-0.1.tar.gz.

File metadata

  • Download URL: z3c.autoinclude-0.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for z3c.autoinclude-0.1.tar.gz
Algorithm Hash digest
SHA256 0562d1d8f296d02e874b7d39bcb0d3e378102d9b77fa22db56b69085c797562b
MD5 e6c4c07d8c16fe54009461e94c1142eb
BLAKE2b-256 e005ae821e0ff63c9cbeccfc8aded9ea6ff4829dfcbf6871ce1e7ac10922d6e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page