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

ApiVer for command line #238

Closed
wants to merge 1 commit into from
Closed

Conversation

kkalinowski-reef
Copy link

@kkalinowski-reef kkalinowski-reef commented Dec 13, 2023

  • _b2v4, b2v3 and b2 (pointing to b2v3) provided as binaries;
  • tests running for both versions 3 and 4;
  • ability to specify version in both unit and integration tests;
  • ability to force version for integration tests using particular sut;
  • doc is built for the latest stable version.

Copy link

@mjurbanski-reef mjurbanski-reef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all new modules should be moved to b2._internal to discourage anyone from trying to import from them

b2.spec.template Outdated
@@ -8,7 +8,7 @@ block_cipher = None
# https://github.com/Backblaze/B2_Command_Line_Tool/issues/689
datas = copy_metadata('b2') + collect_data_files('dateutil')

a = Analysis(['b2/console_tool.py'],
a = Analysis(['b2/${VERSION}/__main__.py'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to keep all the binaries in the same place with some generated files, thus breaking the requirement of them being self-contained.

Copy link

@mjurbanski-reef mjurbanski-reef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great !

Please address the comment + make sure README explains to user difference between b2 and b2v3 - most importantly, the fact that for scripting they should use b2v3.

@@ -0,0 +1 @@
Client binary is now handled with ApiVer methodology in mind. `b2` executable points to the latest stable version, while other versions can be called directly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.added.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you also moved internal stuff (also the old ones) to _internal please also add changed note in addition to this

noxfile.py Outdated
versions = get_versions()

# It is assumed that the last element will be the "latest stable".
# This may not hold true after version 10.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding key=lambda x: [int(num) for num in re.findall(r'\d+', x)] in get_versions should fix this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with a slightly different solution, that matches the behaviour of the b2/_internalg/version_listing.py:get_versions().

- `b2`, `b2v3` and unstable `_b2v4` scripts and binaries are now built.
- Tests are ran against all available versions.
- Both unit and integration tests have the ability to limit versions
  on which given tests are running.
- `doc` is built only for the latest stable version.
- Implementation moved to `_internal` to discourage people from importing it.
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.

2 participants