xcookie.builders.github_actions module

class xcookie.builders.github_actions.Actions[source]

Bases: object

Help build Github Action JSON objects

Example

from xcookie.builders.github_actions import Actions import types for attr_name in dir(Actions):

if not attr_name.startswith(‘_’):

attr = getattr(Actions, attr_name) if isinstance(attr, types.MethodType):

print(attr_name) action = attr()

action_versions = {'checkout': 'actions/checkout@v3', 'setup-python': 'actions/setup-python@v4'}
classmethod _available_action_methods()[source]
classmethod _check_for_updates()[source]
classmethod action(*args, **kwargs)[source]

The generic action

classmethod checkout(*args, **kwargs)[source]
classmethod setup_python(*args, **kwargs)[source]
classmethod codecov_action(*args, **kwargs)[source]

References

https://github.com/codecov/codecov-action

classmethod combine_coverage(*args, **kwargs)[source]
classmethod upload_artifact(*args, **kwargs)[source]
classmethod download_artifact(*args, **kwargs)[source]
classmethod msvc_dev_cmd(*args, osvar=None, bits=None, test_condition=None, **kwargs)[source]
classmethod setup_qemu(*args, sensible=False, **kwargs)[source]
classmethod setup_xcode(*args, sensible=False, **kwargs)[source]
classmethod setup_ipfs(*args, **kwargs)[source]
classmethod cibuildwheel(*args, sensible=False, **kwargs)[source]
xcookie.builders.github_actions.build_github_actions(self)[source]

cat ~/code/xcookie/xcookie/rc/tests.yml.in | yq .jobs.lint cat ~/code/xcookie/xcookie/rc/tests.yml.in | yq .jobs.build_and_test_sdist cat ~/code/xcookie/xcookie/rc/tests.yml.in | yq .jobs.deploy cat ~/code/xcookie/xcookie/rc/tests.yml.in | yq .

Example

>>> from xcookie.builders.github_actions import *  # NOQA
>>> from xcookie.main import XCookieConfig
>>> from xcookie.main import TemplateApplier
>>> config = XCookieConfig(tags=['purepy'])
>>> self = TemplateApplier(config)
>>> text = build_github_actions(self)
>>> print(text)
xcookie.builders.github_actions.lint_job(self)[source]
xcookie.builders.github_actions.build_and_test_sdist_job(self)[source]
xcookie.builders.github_actions.build_binpy_wheels_job(self)[source]

cat ~/code/xcookie/xcookie/rc/test_binaries.yml.in | yq .jobs.build_and_test_wheels

Notes

Supported Action platforms:

https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

xcookie.builders.github_actions.get_supported_platform_info(self)[source]
xcookie.builders.github_actions.build_purewheel_job(self)[source]
xcookie.builders.github_actions.test_wheels_job(self, needs=None)[source]
xcookie.builders.github_actions.build_deploy(self, mode='live', needs=None)[source]

Example

>>> from xcookie.builders.github_actions import *  # NOQA
>>> from xcookie.main import XCookieConfig
>>> from xcookie.main import TemplateApplier
>>> config = XCookieConfig(tags=['purepy'], remote_group='Org', repo_name='Repo')
>>> self = TemplateApplier(config)
>>> self._presetup()
>>> text = Yaml.dumps(build_deploy(self))
>>> print(text)
xcookie.builders.github_actions.build_github_release(self, needs=None)[source]

References

https://github.com/marketplace/actions/create-a-release-in-a-github-action https://github.com/softprops/action-gh-release https://github.com/softprops/action-gh-release/issues/20#issuecomment-572245945