Skip to content

Commit e23ede7

Browse files
Merge pull request #682 from aboutcode-org/rename-minecode-pipelines
Rename minecode_pipeline to minecode_pipelines
2 parents 1a72520 + be6693e commit e23ede7

File tree

16 files changed

+48
-28
lines changed

16 files changed

+48
-28
lines changed

.github/workflows/pypi-release-minecode-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
run: python -m pip install flot --user
2424

2525
- name: Build binary wheel and source tarball
26-
run: python -m flot --pyproject pyproject-minecode_pipeline.toml --sdist --wheel --output-dir dist/
26+
run: python -m flot --pyproject pyproject-minecode_pipelines.toml --sdist --wheel --output-dir dist/
2727

2828
- name: Publish to PyPI
2929
if: startsWith(github.ref, 'refs/tags')
3030
uses: pypa/gh-action-pypi-publish@release/v1
3131
with:
32-
password: ${{ secrets.PYPI_API_TOKEN_MINECODE_PIPELINE }}
32+
password: ${{ secrets.PYPI_API_TOKEN_MINECODE_PIPELINES }}
3333

3434
- name: Upload built archives
3535
uses: actions/upload-artifact@v4

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ test_matchcode:
140140
test: test_purldb test_matchcode test_toolkit test_clearcode
141141

142142
test_minecode:
143-
${ACTIVATE} ${PYTHON_EXE} -m pytest -vvs minecode_pipeline
143+
${ACTIVATE} ${PYTHON_EXE} -m pytest -vvs minecode_pipelines
144144

145145
shell:
146146
${MANAGE} shell

minecode_pipeline/tests/pipes/__init__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

minecode_pipeline/miners/pypi.py renamed to minecode_pipelines/miners/pypi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from packageurl import PackageURL
1515

16-
from minecode_pipeline.utils import get_temp_file
16+
from minecode_pipelines.utils import get_temp_file
1717

1818
"""
1919
Visitors for Pypi and Pypi-like Python package repositories.
File renamed without changes.

minecode_pipeline/pipelines/mine_pypi.py renamed to minecode_pipelines/pipelines/mine_pypi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from scanpipe.pipelines import Pipeline
2424
from scanpipe.pipes import federatedcode
2525

26-
from minecode_pipeline.pipes import pypi
26+
from minecode_pipelines.pipes import pypi
2727

2828

2929
class MineandPublishPypiPURLs(Pipeline):
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
3+
# purldb is a trademark of nexB Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/aboutcode-org/purldb for support or download.
7+
# See https://aboutcode.org for more information about nexB OSS projects.
8+
#
9+
10+
import os
11+
import saneyaml
12+
13+
from pathlib import Path
14+
15+
from aboutcode.hashid import PURLS_FILENAME
16+
17+
18+
def write_packageurls_to_file(repo, base_dir, packageurls):
19+
purl_file_rel_path = os.path.join(base_dir, PURLS_FILENAME)
20+
purl_file_full_path = Path(repo.working_dir) / purl_file_rel_path
21+
write_data_to_file(path=purl_file_full_path, data=packageurls)
22+
return purl_file_rel_path
23+
24+
25+
def write_data_to_file(path, data):
26+
path.parent.mkdir(parents=True, exist_ok=True)
27+
with open(path, encoding="utf-8", mode="w") as f:
28+
f.write(saneyaml.dump(data))

0 commit comments

Comments
 (0)