Skip to content
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

Add support for custom packages #717

Merged
merged 15 commits into from
Feb 19, 2024
Merged

Add support for custom packages #717

merged 15 commits into from
Feb 19, 2024

Conversation

angrybayblade
Copy link

Proposed changes

This PR

  • Adds support for custom package type
  • Updates the package manager to manage custom package types
  • Updates fetch command to fetch custom packages when fetching an agent

Fixes

fixes #706

Types of changes

What types of changes does your code introduce to agents-aea?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Lint and unit tests pass locally with my changes and CI passes too
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that code coverage does not decrease.
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Copy link
Author

@angrybayblade angrybayblade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With custom package type you can define you a custom package for a skill or an agent. The custom package should be defined via a component.yaml file. The config file should look like this

name: comonent
author: valory
version: 0.1.0
type: custom
description: The custom component package.
license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
  __init__.py: bafybeidey4syohls5hxmso6qsp5p4uhtzle5txv2mlbym6ktjzknich6oa
  kelly_criterion.py: bafybeibqwl52cnz64cysjd2jnjijuakdvyrffapxq65cdzx6g65gu42deq
fingerprint_ignore_patterns: []
dependencies: {}

The custom component also allows you to define extra parameters like here. At the runtime you can access these parameters using component.get method. Eg component.get("entry_point")

These components can be defined as a dependencies for skill and agent packages to manage python dependencies.

(...)
customs:
- valory/component:0.1.0:bafybeib3mrksfhsym4xktqx44vbpbtbcl57l3tfjh5ev7k6g27pqa4grmy
(...)

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2024

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (1408e07) 90.29% compared to head (abb8a89) 90.26%.

Files Patch % Lines
aea/configurations/base.py 65.62% 11 Missing ⚠️
aea/cli/scaffold.py 85.71% 1 Missing ⚠️
aea/cli/utils/context.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #717      +/-   ##
==========================================
- Coverage   90.29%   90.26%   -0.03%     
==========================================
  Files         371      373       +2     
  Lines       29807    29854      +47     
==========================================
+ Hits        26914    26949      +35     
- Misses       2893     2905      +12     
Flag Coverage Δ
unittests 90.26% <75.92%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

dvilelaf
dvilelaf previously approved these changes Feb 19, 2024
@angrybayblade
Copy link
Author

You can also scaffold custom components using aea scaffold custom

Copy link

@DavidMinarsch DavidMinarsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merging this, please ensure it works downstream in open-autonomy and also in mech repo where there are custom packages already

aea/configurations/base.py Outdated Show resolved Hide resolved
aea/configurations/base.py Show resolved Hide resolved
aea/customs/scaffold/component.yaml Outdated Show resolved Hide resolved
@angrybayblade angrybayblade merged commit 0478d19 into main Feb 19, 2024
35 of 36 checks passed
@angrybayblade angrybayblade mentioned this pull request Feb 21, 2024
12 tasks
@DavidMinarsch DavidMinarsch deleted the feat/custom-packages branch March 24, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for custom components
5 participants