Skip to content

Commit

Permalink
Merge branch 'master' into fix/aws13
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrilRBS authored Sep 23, 2024
2 parents 393abf8 + 88b62a6 commit 512d3ac
Show file tree
Hide file tree
Showing 264 changed files with 3,976 additions and 1,520 deletions.
9 changes: 9 additions & 0 deletions .c3i/authorized_users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1418,3 +1418,12 @@ authorized_users:
- itsmejoeeey
- JustCallMeRay
- shun2wang
- czheng-bt
- jorgen
- simshi
- alatarum
- joda01
- raplonu
- mattkretz
- DannyLihard
- stevenwdv
3 changes: 3 additions & 0 deletions .c3i/conan_v2_ready_references.yml
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ required_for_references:
- libjxl
- libkml
- libliftoff
- liblqr
- liblsl
- libltc
- liblzf
Expand Down Expand Up @@ -982,6 +983,7 @@ required_for_references:
- miniz
- minizip
- minizip-ng
- minmea
- mio
- mlpack
- mm_file
Expand Down Expand Up @@ -1118,6 +1120,7 @@ required_for_references:
- openmvg
- openpam
- openscenegraph
- openslide
- openssh
- openssl
- opensubdiv
Expand Down
124 changes: 0 additions & 124 deletions .github/workflows/linter-conan-v2.yml

This file was deleted.

5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 12-Sep-2024 - 09:23 CEST

- [feature] Add support for Conan 2.7.1 in the CI
- [feature] Add support for Conan 1.65.0 in the CI

### 10-Jul-2024 - 13:22 CEST

- [feature] Add support for Conan 2.5.0 in the CI
Expand Down
158 changes: 1 addition & 157 deletions docs/linters.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@ to configure plugins, warnings and errors which should be enabled or disabled.

* [Understanding the different linters](#understanding-the-different-linters)
* [Running the linters locally](#running-the-linters-locally)
* [Pylint configuration files](#pylint-configuration-files)
* [Linter Warning and Errors](#linter-warning-and-errors)
* [E9006 - conan-import-conanfile: ConanFile should be imported from conan](#e9006---conan-import-conanfile-conanfile-should-be-imported-from-conan)
* [E9005 - conan-missing-name: Every conan recipe must contain the attribute name](#e9005---conan-missing-name-every-conan-recipe-must-contain-the-attribute-name)
* [E9004 - conan-package-name: Conan package names must be lower-case](#e9004---conan-package-name-conan-package-names-must-be-lower-case)
* [E9007 - conan-test-no-name: Do not add name attribute in test package recipes](#e9007---conan-test-no-name-do-not-add-name-attribute-in-test-package-recipes)
* [E9008 - conan-import-errors: Deprecated imports should be replaced by new imports](#e9008---conan-import-errors-deprecated-imports-should-be-replaced-by-new-imports)
* [E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead](#e9009---conan-import-error-conanexception-conanserrors-is-deprecated-and-conanerrors-should-be-used-instead)
* [E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead](#e9010---conan-import-error-conaninvalidconfiguration-conanserrors-is-deprecated-and-conanerrors-should-be-used-instead)
* [E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private](#e9011---conan-import-tools-importing-conantools-or-conantoolsxxxzzzyyy-should-be-considered-as-private)
* [E9012 - conan-attr-version: Recipe should not contain version attribute](#e9012---conan-attr-version-recipe-should-not-contain-version-attribute)<!-- endToc -->
* [Pylint configuration files](#pylint-configuration-files)<!-- endToc -->

## Understanding the different linters

Expand All @@ -42,149 +32,3 @@ Check the [Developing Recipes](developing_recipes_locally.md) for more informati

- [Pylint Recipe](../linter/pylintrc_recipe): This `rcfile` lists plugins and rules to be executed over all recipes (not test package) and validate them.
- [Pylint Test Package Recipe](../linter/pylintrc_testpackage): This `rcfile` lists plugins and rules to be executed over all recipes in test package folders only:

## Linter Warning and Errors

Here is the list of current warning and errors provided by pylint, when using CCI configuration.

### E9006 - conan-import-conanfile: ConanFile should be imported from conan

```python
from conans import ConanFile
```

Should be replaced by:

```python
from conan import Conanfile
```

### E9005 - conan-missing-name: Every conan recipe must contain the attribute name

The attribute `name` is always expected. On the other hand, `version` should not be listed.

```python
def BazConanfile(ConanFile):
name = "baz"
```

### E9004 - conan-package-name: Conan package names must be lower-case

The package name is always lower-case, even when the upstream uses another format

```python
def FoobarConanfile(ConanFile):
name = "foobar"
```

### E9007 - conan-test-no-name: Do not add name attribute in test package recipes

The test package is not a recipe, thus, it should not have a name

```python
def TestPackageConanFile(ConanFile):
name = "test_package" # Wrong!
```

### E9008 - conan-import-errors: Deprecated imports should be replaced by new imports

Read [v2_linter](v2_linter.md) for a list of mappings of v1 to v2.
Regular imports from `conans.tools` are now updated:

```python
from conans import tools
...

tools.rmdir(os.path.join(self.package_folder, "shared"))
```

Should be replaced by specialized tools, prepared for Conan 2.0

```python
from conan.tools.files import rmdir
...

rmdir(self, os.path.join(self.package_folder, "shared"))
```

### E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead

```python
from conans.errors import ConanException
```

Should be replaced by:

```python
from conan.errors import ConanException
```

Only the namespace `conans` has been replaced by `conan`.

### E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead

```python
from conans.errors import ConanInvalidConfiguration
```

Should be replaced by:

```python
from conan.errors import ConanInvalidConfiguration
```

Only the namespace `conans` has been replaced by `conan`.

### E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private

Documented on [conanfile.tools](https://docs.conan.io/1/reference/conanfile/tools.html):
It's not allowed to use `tools.xxx` directly:

```python
from conan import tools
...

tools.scm.Version(self.version)
```

Neither sub modules:

```python
from conan.tools.apple.apple import is_apple_os
```

Only modules under `conan.tools` and `conan.tools.xxx` are allowed:

```python
from conan.tools.files import rmdir
from conan.tools import scm
```

### E9012 - conan-attr-version: Recipe should not contain version attribute

All recipes on CCI should be generic enough to support as many versions as possible, so enforcing a specific
version as attribute will not allow to re-use the same recipe for multiple release versions.

```python
from conan import ConanFile

class FooConanFile(ConanFile):
version = "1.0.0" # Wrong!
```

The package version should be passed as command argument, e.g:

conan create all/ 1.0.0@ -pr:h=default -pr:b=default

Or, if you are running Conan 2.0:

conan create all/ --version=1.0.0 -pr:h=default -pr:b=default

The only exception is when providing ``system`` packages, which are allowed.

```python
from conan import ConanFile

class FooConanFile(ConanFile):
version = "system" # Okay!
```
2 changes: 1 addition & 1 deletion docs/package_templates/autotools_package/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def build_requirements(self):
self.tool_requires("libtool/x.y.z")
# only if upstream configure.ac relies on PKG_CHECK_MODULES macro
if not self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/x.y.z")
self.tool_requires("pkgconf/[>=1.2.3 <2]")
# required to suppport windows as a build machine
if self._settings_build.os == "Windows":
self.win_bash = True
Expand Down
4 changes: 2 additions & 2 deletions docs/package_templates/meson_package/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def validate(self):
# if another tool than the compiler or Meson is required to build the project (pkgconf, bison, flex etc)
def build_requirements(self):
# CCI policy assumes that Meson may not be installed on consumers machine
self.tool_requires("meson/1.2.3")
self.tool_requires("meson/[>=1.2.3 <2]")
# pkgconf is largely used by Meson, it should be added in build requirement when there are dependencies
if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str):
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/[>=2.2 <3]")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def requirements(self):
self.requires(self.tested_reference_str)

def build_requirements(self):
self.tool_requires("meson/1.2.3")
self.tool_requires("meson/[>=1.2.3 <2]")
if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str):
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/[>=2.2 <3]")

def build(self):
meson = Meson(self)
Expand Down
Loading

0 comments on commit 512d3ac

Please sign in to comment.