Skip to content

Commit

Permalink
Merge visitors and mappers modules into miners #515
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Aug 9, 2024
1 parent 70e9a08 commit 59ceeab
Show file tree
Hide file tree
Showing 116 changed files with 3,006 additions and 3,424 deletions.
4 changes: 2 additions & 2 deletions minecode/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
from rest_framework.response import Response

# UnusedImport here!
# But importing the mappers and visitors module triggers routes registration
from minecode import visitors # NOQA
# But importing the miners module triggers routes registration
from minecode import miners # NOQA
from minecode import priority_router
from minecode.models import PriorityResourceURI, ResourceURI, ScannableURI
from minecode.permissions import IsScanQueueWorkerAPIUser
Expand Down
2 changes: 1 addition & 1 deletion minecode/collectors/maven.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dateutil.parser import parse as dateutil_parse
from minecode.visitors.maven import get_artifacts, is_worthy_artifact, build_url_and_filename
from minecode.miners.maven import get_artifacts, is_worthy_artifact, build_url_and_filename
from packagedcode.maven import get_urls
from minecode.utils import fetch_http, get_temp_file
from packagedcode.models import PackageData
Expand Down
3 changes: 1 addition & 2 deletions minecode/management/commands/check_uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

# NOTE: mappers and visitors are Unused Import here: But importing the mappers
# module triggers routes registration
from minecode import mappers # NOQA
from minecode import visitors # NOQA
from minecode import miners # NOQA
from minecode import map_router
from minecode import visit_router
from minecode.models import ResourceURI
Expand Down
4 changes: 2 additions & 2 deletions minecode/management/commands/get_maven_release_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import requests

from minecode.management.commands import VerboseCommand
from minecode.visitors.maven import collect_links_from_text
from minecode.visitors.maven import filter_for_artifacts
from minecode.miners.maven import collect_links_from_text
from minecode.miners.maven import filter_for_artifacts
from packagedb.models import Package


Expand Down
12 changes: 6 additions & 6 deletions minecode/management/commands/import_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
from minecode.management.commands import get_error_message
from minecode.management.commands import VerboseCommand
from minecode.models import ImportableURI
from minecode.visitors.maven import get_artifact_links
from minecode.visitors.maven import get_classifier_from_artifact_url
from minecode.visitors.maven import collect_links_from_text
from minecode.visitors.maven import filter_only_directories
from minecode.visitors.maven import get_artifact_sha1
from minecode.miners.maven import get_artifact_links
from minecode.miners.maven import get_classifier_from_artifact_url
from minecode.miners.maven import collect_links_from_text
from minecode.miners.maven import filter_only_directories
from minecode.miners.maven import get_artifact_sha1
from minecode.model_utils import merge_or_create_package
from packagedcode.models import PackageData
from minecode.visitors.maven import determine_namespace_name_version_from_url
from minecode.miners.maven import determine_namespace_name_version_from_url


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion minecode/management/commands/maven_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import logging
import sys

from minecode.visitors.maven import crawl_maven_repo_from_root
from minecode.miners.maven import crawl_maven_repo_from_root
from minecode.management.commands import VerboseCommand


Expand Down
4 changes: 2 additions & 2 deletions minecode/management/commands/priority_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from django.utils import timezone

# UnusedImport here!
# But importing the mappers and visitors module triggers routes registration
from minecode import visitors # NOQA
# But importing the miners module triggers routes registration
from minecode import miners # NOQA
from minecode import priority_router
from minecode.management.commands import get_error_message
from minecode.management.commands import VerboseCommand
Expand Down
6 changes: 3 additions & 3 deletions minecode/management/commands/run_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from django.utils import timezone

# UnusedImport here!
# But importing the mappers and visitors module triggers routes registration
from minecode import mappers # NOQA
from minecode import visitors # NOQA
# But importing the miners module triggers routes registration

from minecode import miners # NOQA

from minecode import map_router
from minecode.models import ResourceURI
Expand Down
6 changes: 3 additions & 3 deletions minecode/management/commands/run_visit.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import reppy.cache

# UnusedImport here!
# But importing the mappers and visitors module triggers routes registration
from minecode import mappers # NOQA
from minecode import visitors # NOQA
# But importing the miners module triggers routes registration

from minecode import miners # NOQA
from minecode import visit_router

from minecode.management.commands import get_error_message
Expand Down
6 changes: 3 additions & 3 deletions minecode/management/commands/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from django.db import transaction

# UnusedImport here!
# But importing the mappers and visitors module triggers routes registration
from minecode import mappers # NOQA
from minecode import visitors # NOQA
# But importing the miners module triggers routes registration

from minecode import miners # NOQA

from minecode import seed
from minecode.models import ResourceURI
Expand Down
39 changes: 0 additions & 39 deletions minecode/mappers/__init__.py

This file was deleted.

Loading

0 comments on commit 59ceeab

Please sign in to comment.