Commit Graph

28 Commits

Author SHA1 Message Date
Marc Herbert b7e091d2e9 README.rst: add pytest examples and mention tox limitations
The tox indirection layer is convenient except for the usual problems
caused by too many layers of indirection:

- Add some examples and show how it is still possible to use important
  pytest features. This is also useful to boost people familiar with
  Python but not with pytest.

- To stop developers wasting their time trying, document a major
  limitation with the current approach: impossible to run the west
  code in a debugger when it's started from a test.

- Show how the "printf" alternative can work.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-09-01 10:27:52 -07:00
Martí Bolívar 1544b9e977 README: updates
Just some housekeeping.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2023-02-21 08:53:50 -08:00
Martí Bolívar f97f986f30 README.rst: master/main fixes
- the zephyr tree is now on the 'main' branch
- 'west init' no longer assumes 'master'

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-07-28 16:32:34 -07:00
Michael Zimmermann 80bf5cf381 add support for manifest filenames other than west.yml
Signed-off-by: Michael Zimmermann <michael.zimmermann@grandcentrix.net>
2020-08-26 16:44:59 -07:00
Marti Bolivar d0bb31a170 README.rst: update for 0.6
That's nicer.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-07-23 11:02:55 +02:00
Marti Bolivar c23549fe33 README: fix link to docs
Fixes: #264
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-05-16 13:48:29 +02:00
Maciej Sobkowski 8caea7fceb README.rst: correct URL to west documentation
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2019-01-29 07:42:53 -07:00
Marti Bolivar ff209d5692 README.rst: fixes for 0.5.0
Update some stale content.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-25 10:29:02 -07:00
Marti Bolivar 18060dd02a tests: use tox and overhaul project testing
To properly test the project commands, it would be best to have a
fresh west bootstrapper package created and installed on PATH, so it
could be used to run commands exactly as they'd happen if we package
and ship the working tree.

To make that easier, add a dependency on tox and use it for testing:

https://tox.readthedocs.io/en/latest/

From now on, we'll test west by running 'tox' from the repository
root.  This has several advantages over running pytest directly:

- "Just run tox": there are no longer any differences in test invocation
  between POSIX OSes and Windows.

- tox creates an sdist package of the current tree using our setup.py
  and installs it into a new virtual environment, then runs tests
  there.  This removes interference from other packages installed on
  the host (like released bootstrappers that are also installed)

- we get to run multiple shell commands in order, should that ever be needed,
  in our test procedures in a way that won't affect users

With that done, we can re-work the multirepo command testing to invoke
the bootstrapper in the virtual environment, adding various tests and
filling in longstanding testing gaps by adding increased checking of
the results (currently, much of the testing just checks whether
commands do or do not error out, which isn't enough).

These changes were made with a view towards the upcoming changes which
are planned before releasing west "into the wild": the test case code
should be mostly the same before and after the changes, so this serves
as a good baseline against regressions introduced by those upcoming
changes.

Signed-off-by: Marti Bolivar <marti@foundries.io>

[wip] debugging shippable results

Signed-off-by: Marti Bolivar <marti@foundries.io>

[wip] just test one py3

shutil.which west is picking up a 3.4 version in the 3.6 test, oddly

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-09 11:21:05 -07:00
Marti Bolivar 11c79e70ce West v0.4.0
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-11-28 10:16:25 -07:00
Carles Cufi ebc17b9623 West 0.4.0rc1
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-11-28 11:20:52 +01:00
Carles Cufi c4365915e1 bootstrap: Take west url and revision from manifest
In order to support encoding the required west URL and revision when
tagging a manifest for a release, move the metadata regarding west
itself (url and revision) from the command-line to the manifest.
This involves:

- Adding a new "west" section to the manifest that includes the metadata
- Removing the "-w" and "--wr" command-line options
- Parsing the "west" section of the manifest directly in the
bootstrapper

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-11-27 20:44:23 -07:00
Marti Bolivar 662b1b33a8 West 0.3.0
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-11-01 17:15:41 +01:00
Marti Bolivar 629c574cf2 West 0.3.0rc1.
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-11-01 13:36:15 +01:00
Ulf Magnusson c5add1dd91 Add Bash auto-completion script
Currently completes flags and subcommand names.

Fixes: #24

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-01 01:08:38 +01:00
Carles Cufi 1eba32295d bootstrap: Rename -u to -m for consistency
Using `-u` as the manifest URL is confusing because:

* We use `-w` for the west url
* We use `--wr` for the west revision
* We use `--mr` for the manifest revision

Instead, use `-m` which is consistent with the rest of the options.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-26 15:46:38 +01:00
Marti Bolivar 21fda3ab1a West 0.2.0
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-05 15:32:47 +02:00
Marti Bolivar b001a1243d West 0.2.0rc3
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-02 19:29:45 +02:00
Marti Bolivar 166ed2457e Import all west modules from west.
We are getting user feedback about missing dependencies (like
"commands" and "log") that are actually imports of internal west
modules by those names.

We've been playing games with the python path to omit typing "west",
but this always caused inconsistency (as the bootstrapper version is
imported as west._bootstrap.version) and now it's causing outright
user confusion.

Let's just be consistent and import everything as west.xxx.

Fixes #57.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-01 15:12:54 -06:00
Marti Bolivar 797dce2366 README.rst: fix instructions so users get 0.2.0rc2 from pypi
This is leading early testers astray.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-01 15:12:54 -06:00
Marti Bolivar a9785cdfe2 Update instructions for installing a custom bootstrapper
The instructions for using an arbitrary west installation are OK, but
the docs on how to create and install a custom bootstrapper could use
some fixes. Change them to build and install the bootstrapper from a
wheel instead, and provide instructions for how to back that change
out.

(Prefer wheel here to follow the general trend treating them as the
favored package format, and also because the wheel format is
cross-platform.)

While we're here, remove the instructions on executing directly out of
the repository. You can run a custom "main" west via instructions that
are added in this patch, and it doesn't make much sense to run the
bootstrapper unless you've installed it as an entry point script
somewhere.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-24 00:34:22 +02:00
Marti Bolivar d671e63245 Decouple testing from setup.py, fixing sdists
Remove support for python setup.py test in favor of an
environment-variable based approach. Add Windows instructions as well.

With this patch, west can now be installed from a setuptools source
distribution (sdist), e.g. with "pip3 install west-0.1.99.tar.gz".

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-24 00:34:22 +02:00
Ulf Magnusson f8bd521dea Add self-update for West and the manifest
The self-update mechanism checks the West and manifest repositories in
west/ for upstream changes and rebases them to the latest version if any
are found.

'west fetch' and 'west pull' run a self-update before fetching any
project data. It probably makes sense to always work with the latest
version of West and the manifest there. The self-update can be
suppressed with --no-update.

There's also a 'west update' command for manually updating West and/or
the manifest.

West automatically restarts itself after a self-update, before running
any commands or parsing the manifest. This makes it safe to add a new
feature to West and immediately start using it in the manifest.

The restarting is done with a plain exec(3). Getting this to work
required a few changes:

 - West now uses absolute instead of relative imports, to make it
   possible to execute src/west/main.py directly. This also makes it a
   bit simpler to work on West. Relative imports seem to be discouraged
   when googling around a bit.

   __init__.py was removed from src/west. West is more of an application
   than a package now (though it uses some packages internally).

 - The internal 'cmd' package was renamed to 'commands', to avoid
   clashing with a module in the Python standard library.

   'runner' was renamed to 'runners' as well, for consistency.

The tests now have to be run from the West repository root with
'PYTHONPATH=src/west pytest'. The previous testing setup "just working"
relied on having run 'pip3 install -e .' first, which happened to add
src/west to the path due to the bootstrap script being there.

__init__.py was removed from the test directories as well. Packages
mostly make sense for tests if there are naming collisions, and naming
collisions will be obvious if packages aren't used.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-21 16:50:54 -06:00
Marti Bolivar b2d9f99b41 README.rst: add link to zephyr docs
This is useful context.

Fixes #29.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-15 10:33:05 +02:00
Marti Bolivar 34dc0c2246 README: updates for initial PyPI upload
Fixes and updates to the README before the first upload to PyPI.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-11 18:55:54 +02:00
Marti Bolivar 9b7d58343f Add py.test-based test infrastructure
Follow along with what the cool kids are doing and add py.test
integration.

This patch doesn't add any test cases, but sets up packages to
test the runner classes as additional work.

To run the test suite, use:

$ python3 setup.py test

Since there are no tests, these pass.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-08-20 09:17:57 -07:00
Marti Bolivar 8e22ca68c3 Add bootstrap script.
Add a separate package for bootstrapping West and a Zephyr manifest
repository, and have the setuptools integration install that instead
of the "real" West.

Signed-off-by: Marti Bolivar <marti.f.bolivar@gmail.com>
2018-06-11 21:43:50 -04:00
Marti Bolivar 2e9e6b255d Add setuptools integration.
Follow along with the tutorial:

https://packaging.python.org/tutorials/packaging-projects/

The version number is because of repeated uploads to TestPyPI.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-06-06 12:21:14 -04:00