Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
s-westphal committed Jun 26, 2024
1 parent 7e91b79 commit b1186a0
Show file tree
Hide file tree
Showing 28 changed files with 1,533 additions and 874 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ jobs:
python-version: '3.9'
- name: Verify requirements
run: |
./travis/compile_requirements.sh ubuntu_requirements ubuntu
./travis/compile_requirements.sh ubuntu
- name: Upload requirements to GitHub artifacts
uses: actions/upload-artifact@v4
with:
name: ubuntu-requirements
path: ubuntu_requirements/
path: requirements/
retention-days: 3
- name: Set up
run: |
Expand Down Expand Up @@ -126,12 +126,12 @@ jobs:
virtualenv "${HOME}/INSTALL"
- name: Verify requirements
run: |
./travis/compile_requirements.sh osx_requirements osx
./travis/compile_requirements.sh osx
- name: Upload requirements to GitHub artifacts
uses: actions/upload-artifact@v4
with:
name: osx-requirements
path: osx_requirements/
path: requirements/
retention-days: 3
- name: Build installers
run: |
Expand All @@ -156,12 +156,12 @@ jobs:
- uses: actions/checkout@v4
- name: Verify requirements
run: |
./travis/compile_requirements.sh centos_requirements
./travis/compile_requirements.sh centos
- name: Upload requirements to GitHub artifacts
uses: actions/upload-artifact@v4
with:
name: centos-requirements
path: centos_requirements/
path: requirements/
retention-days: 3
- name: Build installers
run: |
Expand Down Expand Up @@ -197,12 +197,12 @@ jobs:
python-version: '3.9'
- name: Verify requirements
run: |
.\travis\compile_requirements.bat windows_requirements
.\travis\compile_requirements.bat
- name: Upload requirements to GitHub artifacts
uses: actions/upload-artifact@v4
with:
name: windows-requirements
path: windows_requirements/
path: requirements/
retention-days: 3
- name: Build installers
shell: bash
Expand Down
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,15 @@ WORKDIR ${GRR_SOURCE}

RUN ${VIRTUAL_ENV}/bin/python -m pip install --require-hashes \
-r travis/requirements/ubuntu.txt
RUN ${VIRTUAL_ENV}/bin/python -m pip install --no-deps --no-index \
-e grr/proto

RUN ${VIRTUAL_ENV}/bin/python -m pip install --no-deps --no-index \
-e grr/core

RUN ${VIRTUAL_ENV}/bin/python -m pip install --no-deps --no-index \
-e grr/client

RUN ${VIRTUAL_ENV}/bin/python -m pip install --no-deps --no-index \
-e grr/server

RUN ${VIRTUAL_ENV}/bin/python -m pip install --no-deps --no-index \
-e grr/client_builder

RUN ${VIRTUAL_ENV}/bin/python -m pip install --no-deps --no-index \
-e grr/proto \
-e grr/core \
-e grr/client \
-e grr/server \
-e grr/client_builder \
-e api_client/python


RUN ${VIRTUAL_ENV}/bin/python grr/proto/makefile.py && \
${VIRTUAL_ENV}/bin/python grr/core/grr_response_core/artifacts/makefile.py

Expand Down
8 changes: 4 additions & 4 deletions api_client/python/requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cryptography>=3.3.2
ipython==7.15.0
requests==2.32.3
setuptools
Werkzeug==2.1.2
requests>=2.25.1,<3
Werkzeug>=2.1.2,<3
# only required for shell
ipython==7.15.0
92 changes: 46 additions & 46 deletions api_client/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,70 +20,70 @@


def get_config():
"""Get INI parser with version.ini data."""
# TODO(hanuszczak): See comment in `setup.py` for `grr-response-proto`.
ini_path = os.path.join(THIS_DIRECTORY, "version.ini")
"""Get INI parser with version.ini data."""
# TODO(hanuszczak): See comment in `setup.py` for `grr-response-proto`.
ini_path = os.path.join(THIS_DIRECTORY, "version.ini")
if not os.path.exists(ini_path):
ini_path = os.path.join(THIS_DIRECTORY, "../../version.ini")
if not os.path.exists(ini_path):
ini_path = os.path.join(THIS_DIRECTORY, "../../version.ini")
if not os.path.exists(ini_path):
raise RuntimeError("Couldn't find version.ini")
raise RuntimeError("Couldn't find version.ini")

config = configparser.ConfigParser()
config.read(ini_path)
return config
config = configparser.ConfigParser()
config.read(ini_path)
return config


class Sdist(sdist):
"""Build sdist."""
"""Build sdist."""

def make_release_tree(self, base_dir, files):
sdist.make_release_tree(self, base_dir, files)
def make_release_tree(self, base_dir, files):
sdist.make_release_tree(self, base_dir, files)

sdist_version_ini = os.path.join(base_dir, "version.ini")
if os.path.exists(sdist_version_ini):
os.unlink(sdist_version_ini)
shutil.copy(
os.path.join(THIS_DIRECTORY, "../../version.ini"), sdist_version_ini
)
sdist_version_ini = os.path.join(base_dir, "version.ini")
if os.path.exists(sdist_version_ini):
os.unlink(sdist_version_ini)
shutil.copy(
os.path.join(THIS_DIRECTORY, "../../version.ini"), sdist_version_ini
)


VERSION = get_config()


def parse_requirements(filename: str) -> List[str]:
requirements = []
with open(filename) as file:
for line in file:
requirement = line.strip()
if (comment := requirement.find("#")) >= 0:
requirement = requirement[:comment].strip()
requirements.append(requirement)
requirements = []
with open(filename) as file:
for line in file:
requirement = line.strip()
if (comment := requirement.find("#")) >= 0:
requirement = requirement[:comment].strip()
requirements.append(requirement)

return requirements
return requirements


setup_args = dict(
name="grr-api-client",
version=VERSION.get("Version", "packageversion"),
description="GRR API client library",
license="Apache License, Version 2.0",
url="https://github.com/google/grr/tree/master/api_client/python",
maintainer="GRR Development Team",
maintainer_email="[email protected]",
cmdclass={
"sdist": Sdist,
},
packages=find_packages(),
entry_points={
"console_scripts": [
"grr_api_shell = grr_api_client.api_shell:main",
]
},
install_requires=[
"grr_response_proto==%s" % VERSION.get("Version", "packagedepends"),
name="grr-api-client",
version=VERSION.get("Version", "packageversion"),
description="GRR API client library",
license="Apache License, Version 2.0",
url="https://github.com/google/grr/tree/master/api_client/python",
maintainer="GRR Development Team",
maintainer_email="[email protected]",
cmdclass={
"sdist": Sdist,
},
packages=find_packages(),
entry_points={
"console_scripts": [
"grr_api_shell = grr_api_client.api_shell:main",
]
+ parse_requirements("requirements.in"),
data=["version.ini", "requirements.in"],
},
install_requires=[
"grr_response_proto==%s" % VERSION.get("Version", "packagedepends"),
]
+ parse_requirements("requirements.in"),
data=["version.ini", "requirements.in"],
)

setup(**setup_args)
3 changes: 3 additions & 0 deletions grr/client/build_requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
grpcio-tools==1.43.0
grpcio==1.46.3
protobuf==3.20.3
145 changes: 145 additions & 0 deletions grr/client/build_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --generate-hashes grr/client/build_requirements.in
#
grpcio==1.46.3 \
--hash=sha256:01f3f7a6cdb111cf276ffff9c892fa32624e03999bac809d3f3d8321d98b6855 \
--hash=sha256:0a5012ba00cf8b7ce9e6ac2312ace0b0e16fe9502c18340c8c3ecb734a759831 \
--hash=sha256:0c89ae010c57333dd3c692e0892199a59df1ddfd467cdfea31f98331d0e8cf87 \
--hash=sha256:158b90d4f1354f40e435f4c866057acc29a4364b214c31049c8b8c903646fbab \
--hash=sha256:2334ceeab4084e80433693451452cba26afc1607a7974133af3b3635fc8aa935 \
--hash=sha256:26136c19d96e2138f04412101f3730d66f5f1515dc912ac0d415587c8208d826 \
--hash=sha256:2c96a6103caec84985bb2cffac2b261f8cac2641e7a70d4b43b7d08754a6cfe7 \
--hash=sha256:307ff1d6237d5c383196660a12db021c20280227f9f4423d88d6b2ab20c8b1d0 \
--hash=sha256:34b206cdf78dd1c14d93e10e7308750c36b4e6754d579895cba74341875e2fb5 \
--hash=sha256:3585a6fa3d97fc8f030bbf0e88185b5eb345a340f6732e165d5c22df54de5bc6 \
--hash=sha256:3af2cc4e41f87d3b57f624b1b14321c1d0f030b191da60f9eeeda5448d83240c \
--hash=sha256:4b8fd8b1cd553635274b83cd984f0755e6779886eca53c1c71d48215962eb689 \
--hash=sha256:4c05dbc164c2d3015109292ffeed68292807a6cb1225f9a36699bf2166634908 \
--hash=sha256:4caf87a06de88e3611a4610c57ef55b78801843d1f5a9e5fd6b75e887dad3340 \
--hash=sha256:4faaba7db078a0001a8c1a4370d56dc454c03b4613b6acec01f14b90c8dd03cf \
--hash=sha256:4fd0aa30a938893060defd5f222604461db55f9a81a028b154479b91deac7074 \
--hash=sha256:5210ec7a1638daa61da16487fbfafb3dbb7b8cd44382d9262316bbb58a5b1cf7 \
--hash=sha256:53fff69fd4d315adddda226e7b71804d1f12adf3a4162126dc520725624a483a \
--hash=sha256:56636ebf8db63ba50d272dfd73c92538950525120311676246f8f6a81b0aa144 \
--hash=sha256:5969f63f3cf92538f83f26949d393d9fc59de670f47cf7c2a0e1e0d30b770294 \
--hash=sha256:5f8134d4a7e76c8c6644bd3ce728b9894933575155d02c09922986d5d8d6e48c \
--hash=sha256:5fb7779ae01c20c4fad5831e98003b3f036acfe6b77697d6a9baa0f9a7f14daf \
--hash=sha256:6d51fa98bd40d4593f819a3fec8a078a192958d24f84c3daf15b5ad7705d4c48 \
--hash=sha256:707b85fa0cf606a9ab02246bd3142c76e154f1c30f00f7346b2afa3d0b315d5a \
--hash=sha256:71d46c2f3c0512bac3d658af3193e3d645c96123af56bd07a8416474c69df2cf \
--hash=sha256:7a39d39da8855b03be2d7348387986bab6a322031fcc8b04fa5e72355e7b13a1 \
--hash=sha256:7b59982e405159385d5796aa1e0817ec83affb3eb4c2a5b7ca39413d17d7e332 \
--hash=sha256:7d4148f1f76516b01cccf2273b45bc706847f1560ccb55aa6e29df851e9ca8cc \
--hash=sha256:8c63e7c61c0b06f838e8f45ffd3a7c68a520c4c026b2e0e8b1ad29c456d0f859 \
--hash=sha256:8c9106ef35239767b3aa9dc1a79856ad499655f853fca9f92f9dd3182d646627 \
--hash=sha256:9014aee70e29911008d2f388011cabf2c7fe4fe29918ce5f71513a660494069a \
--hash=sha256:91aaccbe1c035ad2bcd1b8a25cebd11839070eb70fb6573e9d0197ddbca5d96b \
--hash=sha256:97801afa96a819f911d030b490dbea95b246de02433bac69c5acf150081686e4 \
--hash=sha256:9c97106134de70f8323b12738ac0adf0615688b69253002910d0c5d42d202a77 \
--hash=sha256:a19b3ecdb8ddf60e4b034def27636065e49ac1ee3c85854a16353cf52c2afd83 \
--hash=sha256:a6bb52df85a4bd6d3bad16b4e7cc43efe95469b74a856c87a2c5bef496c9147f \
--hash=sha256:a898b0f13bda2dfe786952cc1ea705762fa6c3ae799b4bb0525d7821605ae968 \
--hash=sha256:a8f40dafcdc3e0e378387953528eaf4e35758161f3b10d96199f12b11afbe2c2 \
--hash=sha256:aac6e66acae82be5c99a0a40ab8f5733d7df76a04f242cf42ecc34cfb1e947bd \
--hash=sha256:ab18e85082003d7883a4d069065436e61cb27c2c2150e7965ce93658f17bc8da \
--hash=sha256:aff6d961d6bc5e34e12e148383671f8da5d17e47ed606ec15f483def3053b206 \
--hash=sha256:be1679d814a292a701f45df324e25b060435dd13159e9b08a16e2a2396c4391c \
--hash=sha256:c6a460b6aaf43428d48fececad864cc562458b944df80568e490d985d8576292 \
--hash=sha256:c6fe85e5873d9784ab82cf261d9fc07ed67a4459ba69fbe1187ef8b8e3d9e30e \
--hash=sha256:d41ea8efb87b1ae4e576b13d94f2b470297a1495ae6b2c9d1047952731bf168f \
--hash=sha256:dc6d15cbcceaebaacf2994280ed1c01d42b5772059b30afd8a76152e9d23daa4 \
--hash=sha256:df980c4901a92ca649e18036ff67c7c8cad239b2759c2472694f7ab0f0b4ffb9 \
--hash=sha256:e0486485d59d5865149010966ef3df99c5df97ab8b01f10e26f8759d6e10fafc \
--hash=sha256:e0ae8e8523308bf7ab0b7d6aa686011de59b19fb06abb253f302d0b5da2a5905 \
--hash=sha256:e278fa30d2b5652f7e43970c86ad34c639146443553678b746909aae204924dc \
--hash=sha256:e9bba429eb743471715e6dadf006a70a77cb6afb065aa4a6eaa9efd76b09e336 \
--hash=sha256:f5c6393fa645183ae858ebfbf72ab94e7ebafb5cd849dcf4ae8c53a83cce4e24 \
--hash=sha256:f7637b55662e56a64c07846bc0d2da6232a6e893b22c39790f2e41d03ac1a826 \
--hash=sha256:ffbbb228e6fc6f85b34aac428eb76b4fc6591d771e487ce46eb16b4b7e18b91d
# via
# -r grr/client/build_requirements.in
# grpcio-tools
grpcio-tools==1.43.0 \
--hash=sha256:010a4be6a2fccbd6741a4809c5da7f2e39a1e9e227745e6b495be567638bbeb9 \
--hash=sha256:019f55929e963214471825c7a4cdab7a57069109d5621b24e4db7b428b5fe47d \
--hash=sha256:04f100c1f6a7c72c537760c33582f6970070bd6fa6676b529bccfa31cc58bc79 \
--hash=sha256:05550ba473cff7c09e905fcfb2263fd1f7600389660194ec022b5d5a3802534b \
--hash=sha256:09464c6b17663088144b7e6ea10e9465efdcee03d4b2ffefab39a799bd8360f8 \
--hash=sha256:178a881db5de0f89abf3aeeb260ecfd1116cc31f88fb600a45fb5b19c3323b33 \
--hash=sha256:18870dcc8369ac4c37213e6796d8dc20494ea770670204f5e573f88e69eaaf0b \
--hash=sha256:1adb0dbcc1c10b86dcda910b8f56e39210e401bcee923dba166ba923a5f4696a \
--hash=sha256:1def9b68ac9e62674929bc6590a33d89635f1cf16016657d9e16a69f41aa5c36 \
--hash=sha256:234c7a5af653357df5c616e013173eddda6193146c8ab38f3108c4784f66be26 \
--hash=sha256:2458d6b0404f83d95aef00cec01f310d30e9719564a25be50e39b259f6a2da5d \
--hash=sha256:2737f749a6ab965748629e619b35f3e1cbe5820fc79e34c88f73cb99efc71dde \
--hash=sha256:2e9bb5da437364b7dcd2d3c6850747081ecbec0ba645c96c6d471f7e21fdcadb \
--hash=sha256:3eb4aa5b0e578c3d9d9da8e37a2ef73654287a498b8081543acd0db7f0ec1a9c \
--hash=sha256:426f16b6b14d533ce61249a18fbcd1a23a4fa0c71a6d7ab347b1c7f862847bb8 \
--hash=sha256:4c5c80098fa69593b828d119973744de03c3f9a6935df8a02e4329a39b7072f5 \
--hash=sha256:53f7dcaa4218df1b64b39d0fc7236a8270e8ab2db4ab8cd1d2fda0e6d4544946 \
--hash=sha256:55c2e604536e06248e2f81e549737fb3a180c8117832e494a0a8a81fbde44837 \
--hash=sha256:5be6d402b0cafef20ba3abb3baa37444961d9a9c4a6434d3d7c1f082f7697deb \
--hash=sha256:5f2e584d7644ef924e9e042fa151a3bb9f7c28ef1ae260ee6c9cb327982b5e94 \
--hash=sha256:61ef6cb6ccf9b9c27bb85fffc5338194bcf444df502196c2ad0ff8df4706d41e \
--hash=sha256:63862a441a77f6326ea9fe4bb005882f0e363441a5968d9cf8621c34d3dadc2b \
--hash=sha256:671e61bbc91d8d568f12c3654bb5a91fce9f3fdfd5ec2cfc60c2d3a840449aa6 \
--hash=sha256:6dea0cb2e79b67593553ed8662f70e4310599fa8850fc0e056b19fcb63572b7f \
--hash=sha256:6eaf97414237b8670ae9fa623879a26eabcc4c635b550c79a81e17eb600d6ae3 \
--hash=sha256:766771ef5b60ebcba0a3bdb302dd92fda988552eb8508451ff6d97371eac38e5 \
--hash=sha256:8953fdebef6905d7ff13a5a376b21b6fecd808d18bf4f0d3990ffe4a215d56eb \
--hash=sha256:98dcb5b756855110fb661ccd6a93a716610b7efcd5720a3aec01358a1a892c30 \
--hash=sha256:9dbb6d1f58f26d88ae689f1b49de84cfaf4786c81c01b9001d3ceea178116a07 \
--hash=sha256:b68cc0c95a0f8c757e8d69b5fa46111d5c9d887ae62af28f827649b1d1b70fe1 \
--hash=sha256:ba3da574eb08fcaed541b3fc97ce217360fd86d954fa9ad6a604803d57a2e049 \
--hash=sha256:c39cbe7b902bb92f9afaa035091f5e2b8be35acbac501fec8cb6a0be7d7cdbbd \
--hash=sha256:ce13a922db8f5f95c5041d3a4cbf04d942b353f0cba9b251a674f69a31a2d3a6 \
--hash=sha256:d21928b680e6e29538688cffbf53f3d5a53cff0ec8f0c33139641700045bdf1a \
--hash=sha256:d7173ed19854d1066bce9bdc09f735ca9c13e74a25d47a1cc5d1fe803b53bffb \
--hash=sha256:d7e3662f62d410b3f81823b5fa0f79c6e0e250977a1058e4131867b85138a661 \
--hash=sha256:e6c0e1d1b47554c580882d392b739df91a55b6a8ec696b2b2e1bbc127d63df2c \
--hash=sha256:e956b5c3b586d7b27eae49fb06f544a26288596fe12e22ffec768109717276d1 \
--hash=sha256:ebfb94ddb454a6dc3a505d9531dc81c948e6364e181b8795bfad3f3f479974dc \
--hash=sha256:efd1eb5880001f5189cfa3a774675cc9bbc8cc51586a3e90fe796394ac8626b8 \
--hash=sha256:f19d40690c97365c1c1bde81474e6f496d7ab76f87e6d2889c72ad01bac98f2d \
--hash=sha256:f42f1d713096808b1b0472dd2a3749b712d13f0092dab9442d9c096446e860b2 \
--hash=sha256:f974cb0bea88bac892c3ed16da92c6ac88cff0fea17f24bf0e1892eb4d27cd00 \
--hash=sha256:f97f9ffa49348fb24692751d2d4455ef2968bd07fe536d65597caaec14222629
# via -r grr/client/build_requirements.in
protobuf==3.20.3 \
--hash=sha256:03038ac1cfbc41aa21f6afcbcd357281d7521b4157926f30ebecc8d4ea59dcb7 \
--hash=sha256:28545383d61f55b57cf4df63eebd9827754fd2dc25f80c5253f9184235db242c \
--hash=sha256:2e3427429c9cffebf259491be0af70189607f365c2f41c7c3764af6f337105f2 \
--hash=sha256:398a9e0c3eaceb34ec1aee71894ca3299605fa8e761544934378bbc6c97de23b \
--hash=sha256:44246bab5dd4b7fbd3c0c80b6f16686808fab0e4aca819ade6e8d294a29c7050 \
--hash=sha256:447d43819997825d4e71bf5769d869b968ce96848b6479397e29fc24c4a5dfe9 \
--hash=sha256:67a3598f0a2dcbc58d02dd1928544e7d88f764b47d4a286202913f0b2801c2e7 \
--hash=sha256:74480f79a023f90dc6e18febbf7b8bac7508420f2006fabd512013c0c238f454 \
--hash=sha256:819559cafa1a373b7096a482b504ae8a857c89593cf3a25af743ac9ecbd23480 \
--hash=sha256:899dc660cd599d7352d6f10d83c95df430a38b410c1b66b407a6b29265d66469 \
--hash=sha256:8c0c984a1b8fef4086329ff8dd19ac77576b384079247c770f29cc8ce3afa06c \
--hash=sha256:9aae4406ea63d825636cc11ffb34ad3379335803216ee3a856787bcf5ccc751e \
--hash=sha256:a7ca6d488aa8ff7f329d4c545b2dbad8ac31464f1d8b1c87ad1346717731e4db \
--hash=sha256:b6cc7ba72a8850621bfec987cb72623e703b7fe2b9127a161ce61e61558ad905 \
--hash=sha256:bf01b5720be110540be4286e791db73f84a2b721072a3711efff6c324cdf074b \
--hash=sha256:c02ce36ec760252242a33967d51c289fd0e1c0e6e5cc9397e2279177716add86 \
--hash=sha256:d9e4432ff660d67d775c66ac42a67cf2453c27cb4d738fc22cb53b5d84c135d4 \
--hash=sha256:daa564862dd0d39c00f8086f88700fdbe8bc717e993a21e90711acfed02f2402 \
--hash=sha256:de78575669dddf6099a8a0f46a27e82a1783c557ccc38ee620ed8cc96d3be7d7 \
--hash=sha256:e64857f395505ebf3d2569935506ae0dfc4a15cb80dc25261176c784662cdcc4 \
--hash=sha256:f4bd856d702e5b0d96a00ec6b307b0f51c1982c2bf9c0052cf9019e9a544ba99 \
--hash=sha256:f4c42102bc82a51108e449cbb32b19b180022941c727bac0cfd50170341f16ee
# via
# -r grr/client/build_requirements.in
# grpcio-tools
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
# via grpcio

# WARNING: The following packages were not pinned, but pip requires them to be
# pinned when the requirements file includes hashes and the requirement is not
# satisfied by a package already installed. Consider using the --allow-unsafe flag.
# setuptools
Loading

0 comments on commit b1186a0

Please sign in to comment.