DPDK patches and discussions
 help / color / mirror / Atom feed
From: Robin Jarry <robin.jarry@6wind.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net
Subject: Re: [dpdk-dev] [PATCH v3] build: allow using wildcards to disable drivers
Date: Fri, 24 Jan 2020 13:28:07 +0100
Message-ID: <20200124122807.5jgyogqxyogy5yug@6wind.com> (raw)
In-Reply-To: <20200124103257.44092-1-bruce.richardson@intel.com>

2020-01-24, Bruce Richardson:
> Rather than having to explicitly list each and every driver to disable in a
> build, we can use a small python script and the python glob library to
> expand out the wildcards. This means that we can configure meson using e.g.
> 
>     meson -Ddisable_drivers=crypto/*,event/* build
> 
> to do a build omitting all the crypto and event drivers. Explicitly
> specified drivers e.g. net/i40e, work as before, and can be mixed with
> wildcarded drivers as required.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
[snip]
> +from os.path import join, relpath, isdir

As a general rule, it is better to only import one symbol per line. This
makes subsequent patches easier to read.

> +if len(sys.argv) != 2:
> +  print("Usage: {0} <path-glob>[,<path-glob>[,...]]".format(sys.argv[0]))
> +  sys.exit(1)

PEP8 advises to use 4 spaces per indentation level. This is the
indentation style adopted by all other python scripts in dpdk (see
doc/guides/contributing/coding_style.rst). Could you fix that?

> +root = '.'
> +if 'MESON_SOURCE_ROOT' in os.environ and 'MESON_SUBDIR' in os.environ:
> +  root = join(os.environ['MESON_SOURCE_ROOT'], os.environ['MESON_SUBDIR'])

You can do simpler and shorter:

  root = join(os.getenv('MESON_SOURCE_ROOT', ''),
              os.getenv('MESON_SUBDIR', ''), '.')

Sorry to pester you with all this, but python code in DPDK really needs
some loving :-)

-- 
Robin

  reply	other threads:[~2020-01-24 12:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20 17:37 [dpdk-dev] [PATCH] " Bruce Richardson
2020-01-20 18:59 ` Thomas Monjalon
2020-01-21  9:11   ` Robin Jarry
2020-01-21 10:17     ` Bruce Richardson
2020-01-21 10:13   ` Bruce Richardson
2020-01-21 11:12 ` [dpdk-dev] [PATCH v2] " Bruce Richardson
2020-01-21 13:22   ` Robin Jarry
2020-01-21 13:37     ` Bruce Richardson
2020-01-21 13:48       ` Robin Jarry
2020-01-24 10:32 ` [dpdk-dev] [PATCH v3] " Bruce Richardson
2020-01-24 12:28   ` Robin Jarry [this message]
2020-01-24 14:57     ` Richardson, Bruce
2020-01-24 15:10 ` [dpdk-dev] [PATCH v4] " Bruce Richardson
2020-01-24 15:34   ` Robin Jarry
2020-01-27 11:26   ` Andrzej Ostruszka
2020-01-27 12:15     ` Bruce Richardson
2020-01-27 12:12   ` Luca Boccassi
2020-01-27 14:28 ` [dpdk-dev] [PATCH v5] " Bruce Richardson
2020-02-06  2:26   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200124122807.5jgyogqxyogy5yug@6wind.com \
    --to=robin.jarry@6wind.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git