• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 7763
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: add/port-target-adaptor-and-source-block
DEFAULT BRANCH: main
Ran 05 Nov 2015 08:29PM UTC
Jobs 8
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
7763

push

travis-ci

Benjy
Get rid of argparse usage entirely.

It had become an implementation detail, and a minor one at that.
We had already duplicated a lot of its logic (around types and actions,
in particular) in order to correctly compute defaults.  So we might as
well go the extra mile and get rid of it. Especially since its init
sequence is quite expensive, and we create one argparser per scope,
which is not how it was designed to be used.

This meant we had to implement a couple of extra bits of functionality
that argparse did previously handle for us:
  - choices
  - nargs=?. Instead of implementing nargs fully, we now allow
    an implicit_value= kwarg, which provides the value if you
    specify a flag with no value (e.g., --foo instead of --foo=bar).
    This is the only thing we were using nargs for, and even that
    only in one place.

This allows us to simplify OptionValueContainer, as we can now guarantee
that all values set on it are of type RankedValue.

Note that this breaks one little piece of functionality that we
never wanted to begin with: argparse recognizes any unambiguous prefix
of an option. E.g., if we register --foobar, and there's no other option
that starts with --foo, then you only need to use --foo on the cmd line.
This is a very bad feature, because it means command lines will break
as soon as you add a new option with the same prefix.  Sadly, there was
no way to turn it off.  So it's possible that someone somewhere is
relying on this bad behavior, which is now gone. In which case they
will get an "unknown option" error, and will simply have to spell the
option correctly.  They were on thin ice to begin with, so this is not
worth worrying about.

Testing Done:
CI passes: https://travis-ci.org/pantsbuild/pants/builds/89366469

Reviewed at https://rbcommons.com/s/twitter/r/3074/
Jobs
ID Job ID Ran Files Coverage
1 7763.1 (CI_FLAGS="-cjlpn 'Various pants self checks'") 05 Nov 2015 08:29PM UTC 0
Travis Job 7763.1
4 7763.4 (CI_FLAGS="-fkmsrcjlp 'Python contrib tests'") 05 Nov 2015 08:40PM UTC 0
Travis Job 7763.4
5 7763.5 (CI_FLAGS="-fkmsrjlpn -i 0/6 'Python integration tests for pants - shard 1'") 05 Nov 2015 08:36PM UTC 0
Travis Job 7763.5
6 7763.6 (CI_FLAGS="-fkmsrjlpn -i 1/6 'Python integration tests for pants - shard 2'") 05 Nov 2015 08:36PM UTC 0
Travis Job 7763.6
7 7763.7 (CI_FLAGS="-fkmsrjlpn -i 2/6 'Python integration tests for pants - shard 3'") 05 Nov 2015 08:39PM UTC 0
Travis Job 7763.7
8 7763.8 (CI_FLAGS="-fkmsrjlpn -i 3/6 'Python integration tests for pants - shard 4'") 05 Nov 2015 08:38PM UTC 0
Travis Job 7763.8
9 7763.9 (CI_FLAGS="-fkmsrjlpn -i 4/6 'Python integration tests for pants - shard 5'") 05 Nov 2015 08:41PM UTC 0
Travis Job 7763.9
10 7763.10 (CI_FLAGS="-fkmsrjlpn -i 5/6 'Python integration tests for pants - shard 6'") 05 Nov 2015 09:00PM UTC 0
Travis Job 7763.10
Source Files on build 7763
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #7763
  • d6b1ade5 on github
  • Prev Build on master (#7762)
  • Next Build on master (#7766)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc