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

Source dist #7262

Merged
merged 1 commit into from
Oct 20, 2022
Merged

Source dist #7262

merged 1 commit into from
Oct 20, 2022

Conversation

stealthycoin
Copy link
Contributor

No description provided.

Copy link
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

Looks like a good start. I did a preliminary pass through the implementation. I did not get to dive too much into the tests nor trying out the implementation yet. I'll try to get through that in the next pass.

.github/workflows/source-dist-tests.yml Outdated Show resolved Hide resolved
MANIFEST.in Outdated Show resolved Hide resolved
MANIFEST.in Outdated Show resolved Hide resolved
backends/build_system/__main__.py Show resolved Hide resolved
backends/build_system/__main__.py Outdated Show resolved Hide resolved
backends/build_system/awscli_venv.py Show resolved Hide resolved
backends/build_system/awscli_venv.py Show resolved Hide resolved
requirements/bootstrap.txt Outdated Show resolved Hide resolved
bin/aws_bash_completer Outdated Show resolved Hide resolved
backends/build_system/exe.py Show resolved Hide resolved
Copy link
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

I just did a follow up pass in trying it all out locally. It was looking good. Just left some comments after trying it out a bit.

[with_download_deps=no]
)
if test "$with_download_deps" = no; then
${PYTHON} ${srcdir}/backends/build_system validate-env --artifact $with_install_type || AC_MSG_ERROR("Python dependencies not met")
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be worth including as part of the output the suggestion of either install these dependencies yourself or rerun configure with the --with-download-deps flag

AC_ARG_WITH(install_type,
AS_HELP_STRING([--with-install-type=@<:@system-sandbox|portable-exe@:>@],
[Specify type of AWS CLI installation. Options are:
"portable-exe", "system-sandbox" (default is "system-sandbox")]),
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be worth expanding on what each of these install types entail and why to use it. Or if we can add a link to some reference that would be handy too.

[Download all dependencies and use those when
building the AWS CLI. If not specified, the dependencies
(including all python packages) must be installed
on your system]),
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be worth noting some of the caveats with this flag as detailed in the proposal: https://github.com/aws/aws-cli/blob/v2/proposals/source-install.md#backwards-compatibility. Specifically, there is no guarantee that this flag will download all dependencies in future versions and generally there should be no expectation that you upgrade the version of the CLI to install and that flag making build/install process automatically work.

backends/build_system/validate_env.py Outdated Show resolved Hide resolved
Makefile.in Outdated Show resolved Hide resolved
@stealthycoin stealthycoin force-pushed the source-dist branch 4 times, most recently from 0ff0f36 to 54e85a7 Compare September 14, 2022 03:46
@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2022

Codecov Report

Merging #7262 (c31ebe5) into source-distribution (12a87f8) will not change coverage.
The diff coverage is n/a.

@@                 Coverage Diff                  @@
##           source-distribution    #7262   +/-   ##
====================================================
  Coverage                93.70%   93.70%           
====================================================
  Files                      351      351           
  Lines                    36171    36171           
  Branches                  5202     5202           
====================================================
  Hits                     33895    33895           
  Misses                    1652     1652           
  Partials                   624      624           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

It's looking good. Just had some more comments after the latest rebase and looking more into the tests.

requirements/bootstrap.txt Outdated Show resolved Hide resolved
requirements/bootstrap-lock.txt Outdated Show resolved Hide resolved
backends/build_system/utils.py Outdated Show resolved Hide resolved
backends/build_system/utils.py Outdated Show resolved Hide resolved
Comment on lines +33 to +136
dependency_block_re = re.compile(
r"dependencies = \[([\s\S]+?)\]", re.MULTILINE
)
extract_dependencies_re = re.compile(r'"(.+)"')
with open(ROOT_DIR / "pyproject.toml", "r") as f:
data = f.read()
raw_dependencies = dependency_block_re.findall(data)[0]
dependencies = extract_dependencies_re.findall(raw_dependencies)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably reuse this logic from the pep517.py module. In general, I would not be opposed to having a backends/utils.py module for stuff this needs to be shared between this and the PEP517 hooks.

backends/build_system/validate_env.py Outdated Show resolved Hide resolved
tests/backends/build_system/integration/test_makefile.py Outdated Show resolved Hide resolved
requirements/bootstrap-lock.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

Looks good. I mainly focused on the tests this round. I liked the environment abstraction you made for the integration tests.

@stealthycoin stealthycoin force-pushed the source-dist branch 2 times, most recently from d511d64 to 32967eb Compare October 10, 2022 22:06
Copy link
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

It's looking good. I just posted some more smaller comments to help get this polished up so we can merge it to the feature branch.

backends/build_system/install.py Outdated Show resolved Hide resolved
backends/build_system/install.py Outdated Show resolved Hide resolved
backends/build_system/install.py Outdated Show resolved Hide resolved
backends/build_system/utils.py Outdated Show resolved Hide resolved
pip==22.2.2 \
--hash=sha256:3fd1929db052f056d7a998439176d3333fa1b3f6c1ad881de1885c0717608a4b \
--hash=sha256:b61a374b5bc40a6e982426aede40c9b5a08ff20e640f5b56977f4f91fed1e39a
# via -r requirements/bootstrap.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a particular reason we have these top-level bootstrap-lock.txt and bootstrap-win-lock.txt lock files? I would have assumed we would removed them as the ones that would be used are the ones in the download-deps directory.

requirements/download-deps/bootstrap.txt Outdated Show resolved Hide resolved
requirements/portable-exe-extras-win-lock.txt Outdated Show resolved Hide resolved
requirements/runtime-lock.txt Outdated Show resolved Hide resolved
run('python -m build')
wheel_dist = glob.glob(os.path.join('dist', '*.whl'))[0]
run('pip install %s' % wheel_dist)
run("pip install setuptools==57.5.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's make sure to remove this direct install and defer to our requirements files for dependencies.

scripts/ci/install-build-system Outdated Show resolved Hide resolved
@stealthycoin stealthycoin force-pushed the source-dist branch 4 times, most recently from ba0a43f to 901a2d0 Compare October 14, 2022 19:26
Copy link
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

Looks good. Just had a really small clean up comment on print statements, but otherwise let's go ahead and squash this into a single commit.

if ' #' in line:
line = line[:line.find(' #')]
if line.endswith('\\'):
print('before', line)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a left over print statement here and two lines after. We should just grep to make sure all these files to make sure there are no unintended print statements.

Changes:
 * Add python interface for building from source under
   backends/build_system
 * Add autotools interface for calling the python build backend
 * Add requirements/lock files under requirements/ directory needed
   for building form source.
 * Add script for regenerating the requirements lock files from
   scratch.
 * add .gitignore entries for autotools
Copy link
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

Looks good! 🚢

@stealthycoin stealthycoin merged commit 8b6a2fb into aws:source-distribution Oct 20, 2022
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.

3 participants