Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dependabot/pip/requ…
Browse files Browse the repository at this point in the history
…ests-2.32.0
  • Loading branch information
keshav-space committed Sep 10, 2024
2 parents 324394b + db09f99 commit 89008e0
Show file tree
Hide file tree
Showing 25 changed files with 6,665 additions and 15,077 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

v0.5.2
------
- Update link references of ownership from nexB to aboutcode-org


v0.5.1
-------
Expand All @@ -9,7 +13,7 @@ v0.5.1

v0.5.0
-------
- FetchCode now supports retrieving package info for following generic packages:
- FetchCode now supports retrieving package info for following generic packages:
* pkg:generic/linux
* pkg:generic/mtd-utils
* pkg:generic/barebox
Expand Down Expand Up @@ -42,7 +46,7 @@ v0.5.0

v0.4.0
-------
- FetchCode now supports retrieving package info for following generic packages:
- FetchCode now supports retrieving package info for following generic packages:
``busybox``, ``bzip2``, ``dnsmasq``, ``dropbear``, ``ebtables``, ``hostapd``, ``ipkg``,
``iproute2``, ``iptables``, ``libnl``, ``lighttpd``, ``nftables``, ``openssh``, ``samba``,
``syslinux``, ``toybox``, ``uclibc``, ``uclibc-ng``, ``util-linux`` and ``wpa_supplicant``.
Expand All @@ -63,4 +67,3 @@ v0.1.0
---------

First, initial release.

2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) nexB Inc. and others.
# SPDX-License-Identifier: Apache-2.0
#
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
# Visit https://aboutcode.org and https://github.com/aboutcode-org/ for support and download.
# ScanCode is a trademark of nexB Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ systems. It can work using plain HTTP and FTP URLs, as well as
as used in Python pip and as specified in `SPDX Package Download Location
<https://spdx.github.io/spdx-spec/3-package-information/#37-package-download-location>`_

Homepage and support: https://github.com/nexB/fetchcode
Homepage and support: https://github.com/aboutcode-org/fetchcode


Why FetchCode?
Expand All @@ -24,11 +24,11 @@ Development installation

Clone the repo::

git clone https://github.com/nexB/fetchcode
git clone https://github.com/aboutcode-org/fetchcode

Then install all the requirements using::
Then install all the requirements using this command (on POSIX)::

configure --dev
./configure --dev


Running tests
Expand All @@ -45,13 +45,13 @@ Usage
Fetch a code archive and get a ``fetchcode.fetch.Response`` object back::

>>> from fetchcode import fetch
>>> f = fetch('https://github.com/nexB/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip')
>>> f = fetch('https://github.com/aboutcode-org/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip')
>>> f.location
'/tmp/tmp_cm02xsg'
>>> f.content_type
'application/zip'
>>> f.url
'https://github.com/nexB/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip'
'https://github.com/aboutcode-org/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip'

Fetch some package metadata and get a ``fetchcode.packagedcode_models.Package`` object back::

Expand Down
104 changes: 47 additions & 57 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,54 @@

################################################################################
# We use Azure to run the full tests suites on multiple Python 3.x
# on multiple Windows, macOS and Linux versions all on 64 bits
# These jobs are using VMs with Azure-provided Python builds
################################################################################

jobs:

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu22_cpython
image_name: ubuntu-22.04
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos11_cpython
image_name: macOS-11
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython
image_name: macOS-12
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos13_cpython
image_name: macOS-13
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2022_cpython
image_name: windows-2022
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs
- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu22_cpython
image_name: ubuntu-22.04
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython
image_name: macOS-12
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos13_cpython
image_name: macOS-13
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
test_suites:
all: venv\Scripts\pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2022_cpython
image_name: windows-2022
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
test_suites:
all: venv\Scripts\pytest -n 2 -vvs
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) nexB Inc. and others. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/ for support or download.
# See https://github.com/aboutcode-org/ for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#

Expand Down
2 changes: 1 addition & 1 deletion configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@rem Copyright (c) nexB Inc. and others. All rights reserved.
@rem SPDX-License-Identifier: Apache-2.0
@rem See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
@rem See https://github.com/nexB/ for support or download.
@rem See https://github.com/aboutcode-org/ for support or download.
@rem See https://aboutcode.org for more information about nexB OSS projects.


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = Apache-2.0
description = fetchcode is a library to reliably fetch code via HTTP, FTP and version control systems.
long_description = file:README.rst
long_description_content_type = text/x-rst
url = https://github.com/nexB/fetchcode
url = https://github.com/aboutcode-org/fetchcode

author = nexB. Inc. and others
author_email = [email protected]
Expand Down
12 changes: 7 additions & 5 deletions src/fetchcode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# fetchcode is a free software tool from nexB Inc. and others.
# Visit https://github.com/nexB/fetchcode for support and download.
# Visit https://github.com/aboutcode-org/fetchcode for support and download.
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# http://nexb.com and http://aboutcode.org
Expand Down Expand Up @@ -41,7 +41,7 @@ def __init__(self, location, content_type, size, url):
def fetch_http(url, location):
"""
Return a `Response` object built from fetching the content at a HTTP/HTTPS based `url` URL string
saving the content in a file at `location`
saving the content in a file at `location`
"""
r = requests.get(url)
with open(location, 'wb') as f:
Expand All @@ -51,15 +51,16 @@ def fetch_http(url, location):
size = r.headers.get('content-length')
size = int(size) if size else None

resp = Response(location=location, content_type=content_type, size=size, url=url)
resp = Response(location=location,
content_type=content_type, size=size, url=url)

return resp


def fetch_ftp(url, location):
"""
Return a `Response` object built from fetching the content at a FTP based `url` URL string
saving the content in a file at `location`
saving the content in a file at `location`
"""
url_parts = urlparse(url)

Expand All @@ -84,7 +85,8 @@ def fetch_ftp(url, location):
ftp.retrbinary(file, f.write)
ftp.close()

resp = Response(location=location, content_type=content_type, size=size, url=url)
resp = Response(location=location,
content_type=content_type, size=size, url=url)
return resp


Expand Down
Loading

0 comments on commit 89008e0

Please sign in to comment.