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

Feature: add deprecated attribute #7399

Merged
merged 1 commit into from Jul 23, 2020

Conversation

SSE4
Copy link
Contributor

@SSE4 SSE4 commented Jul 22, 2020

closes: #7251

Changelog: Feature: add deprecated attribute
Docs: conan-io/docs#1775

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • 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.

Signed-off-by: SSE4 <tomskside@gmail.com>
@SSE4 SSE4 force-pushed the deprecated_attribute branch from 7c9bc41 to 5af724b Compare Jul 22, 2020
@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented Jul 22, 2020

NOTE: this doesn't print:

WARN.- Recipe 'cpp-taskflow/1.0' is deprecated in favor of 'taskflow/1.0'. Please, consider changing your requirements.

instead, it will print just:

WARN.- Recipe 'cpp-taskflow/1.0' is deprecated in favor of 'taskflow'. Please, consider changing your requirements.

notice taskflow has no version specified.
reason - taskflow/1.0 might not exist - the new version might be taskflow/2.0 for instance.

@memsharded memsharded added this to the 1.28 milestone Jul 22, 2020
Copy link
Member

@danimtb danimtb left a comment

I was wondering if this deprecated attribute is prone to be ser conditionally in the configure() method. Having a look at the implementation, I think it is already working but I am not sure if we have a use case for that 🤔

@memsharded
Copy link
Member

@memsharded memsharded commented Jul 22, 2020

I was wondering if this deprecated attribute is prone to be ser conditionally in the configure() method. Having a look at the implementation, I think it is already working but I am not sure if we have a use case for that 🤔

Well, it is possible that some recipe support for one OS is deprecated, probably not a very common case, so I would be fine even if this didn't work at the moment.

@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented Jul 22, 2020

I don't see any advantage in such complicated use-case as a conditionally deprecated recipe. I'd say let's go with simple implementation, until someone will actually request that feature.

@uilianries
Copy link
Member

@uilianries uilianries commented Jul 22, 2020

One advantage using the current condition, is that we can give a hint to the new reference. This new feature doesn't offer the same case.

Maybe, deprecated could accept a package reference or a boolean:

class Foo(ConanFile):
    ...
    deprecated = True
    # OR
    deprecated = "foobar/0.1.0" # new reference

@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented Jul 22, 2020

@uilianries both are allowed, boolean and reference

@uilianries
Copy link
Member

@uilianries uilianries commented Jul 22, 2020

@memsharded memsharded merged commit 1ba01e6 into conan-io:develop Jul 23, 2020
2 checks passed
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.

4 participants