Skip to content

Commit

Permalink
Merge pull request #127 from miskeens/master
Browse files Browse the repository at this point in the history
GH-126: keep solid artifacts packed for subsequent runs
  • Loading branch information
antonzolotukhin authored Nov 11, 2024
2 parents 1db4867 + b55566d commit f081203
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: CrossPM packages
path: dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v4
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches-ignore:
- master
# Pull Requests can not reuse workflows from the source branch:
# https://github.com/actions/toolkit/issues/932
# pull_request:
# branches:
# - '*'
# Pull Requests can not reuse workflows from the source branch:
# https://github.com/actions/toolkit/issues/932
pull_request:
branches:
- '*'

jobs:
tests:
Expand Down
23 changes: 4 additions & 19 deletions crosspm/adapters/artifactoryaql.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def get_packages(self, source, parser, downloader, list_or_file_path, property_v
_packages_found = OrderedDict()
_pkg_name_old = ""
_packed_exist = False
_packed_cache_params = None
self._log.info('parser: {}'.format(parser._name))
for _paths in parser.get_paths(list_or_file_path, source):

Expand Down Expand Up @@ -118,11 +117,8 @@ def get_packages(self, source, parser, downloader, list_or_file_path, property_v
_packed_exist = os.path.isfile(_path_packed)
if _packed_exist:
self._log.info("Skip searching, use package cache in path {}".format(_path_packed))
_packed_cache_params = param
break # break check local cache
if _packed_exist:
break # break connect to artifactory
# ------ END ----
# ------ END ----
_path_fixed, _path_pattern, _file_name_pattern = parser.split_fixed_pattern_with_file_name(_path)
try:
_artifactory_server = _tmp_params['server']
Expand Down Expand Up @@ -218,17 +214,6 @@ def get_packages(self, source, parser, downloader, list_or_file_path, property_v
last_error = msg

_package = None

# HACK for prefer-local
if _packed_exist:
# HACK - Normalize params for cached archive
for key, value in _packed_cache_params.items():
if isinstance(value, list):
value = ['' if x is None else x for x in value]
_packed_cache_params[key] = value
_package = Package(_pkg_name, None, _paths['params'], downloader, self, parser,
_packed_cache_params, list_or_file_path['raw'], {}, in_cache=True)
# END HACK
if _packages:
_tmp = copy.deepcopy(_params_found)
_packages = parser.filter_one(_packages, _paths['params'], _tmp)
Expand Down Expand Up @@ -272,10 +257,10 @@ def get_packages(self, source, parser, downloader, list_or_file_path, property_v
if _added and (_package is not None):
if downloader.do_load:
_package.download()
_deps_file = _package.get_file(self._config.deps_lock_file_name)
if not _deps_file:
_deps_file = _package.get_file(CROSSPM_DEPENDENCY_LOCK_FILENAME)
if downloader.recursive:
_deps_file = _package.get_file(self._config.deps_lock_file_name)
if not _deps_file:
_deps_file = _package.get_file(CROSSPM_DEPENDENCY_LOCK_FILENAME)
if _deps_file:
_package.find_dependencies(_deps_file, property_validate=False)
elif self._config.deps_file_name:
Expand Down

0 comments on commit f081203

Please sign in to comment.