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 barebones template to conan new #12802

Merged
merged 13 commits into from
Jan 2, 2023

Conversation

AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Dec 28, 2022

Changelog: Feature: Add barebones template option to conan new.
Docs: conan-io/docs#2881

While testing some functionality, I had the need to create a very basic recipe to test some commands on. As I thought that "there probably is a template for it in conan new" and was disappointed when it wasn't.

I had to implement the ability to add multiple values to the same definition, so something like -d requires=math/1.0 -d requires=ai/1.3 would result in

def requirements(self):
  self.requires("math/1.0")
  self.requires("ai/1.3")

without breaking

  • I've followed the PEP8 style guides for Python code.
  • (Will do) I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

I like the idea of having some other convenient templates, they are useful for teaching, testing, examples, etc. I think we can also provide other improvements for the templates, like some templates with requires (not in this PR, just an idea).

Please check the comments, add some simple test to cover it, and it should be good.

conan/internal/api/new/barebones.py Outdated Show resolved Hide resolved
conan/internal/api/new/barebones.py Outdated Show resolved Hide resolved
conan/cli/commands/new.py Outdated Show resolved Hide resolved
@memsharded memsharded added this to the 2.0.0-beta8 milestone Dec 28, 2022
Copy link
Member Author

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

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

Thanks for the reviews, I've implemented most of the requested changes, with only the explanation comments left to do

conan/api/subapi/new.py Outdated Show resolved Hide resolved
conan/internal/api/new/basic.py Outdated Show resolved Hide resolved
conans/test/utils/tools.py Outdated Show resolved Hide resolved
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Looking good

conan/api/subapi/new.py Outdated Show resolved Hide resolved
@AbrilRBS AbrilRBS marked this pull request as ready for review December 30, 2022 12:15
conan/internal/api/new/basic.py Show resolved Hide resolved
conans/test/integration/command/new_test.py Outdated Show resolved Hide resolved
conans/test/utils/tools.py Outdated Show resolved Hide resolved
AbrilRBS and others added 2 commits December 30, 2022 15:22
conans/test/integration/command/new_test.py Outdated Show resolved Hide resolved
conans/test/utils/tools.py Outdated Show resolved Hide resolved
conans/test/utils/tools.py Outdated Show resolved Hide resolved
AbrilRBS and others added 2 commits December 31, 2022 22:36
@memsharded memsharded merged commit 8def152 into conan-io:develop2 Jan 2, 2023
@AbrilRBS AbrilRBS deleted the rr/conan-new-barebones branch January 2, 2023 11:44
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.

3 participants