Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a workaround for the conflict of the name of the modules #783

Merged
merged 1 commit into from
Jul 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion onlinejudge_command/download_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import onlinejudge_command.logging as log
import onlinejudge_command.utils as utils
from onlinejudge_workaround_for_conflict.type import Problem

from onlinejudge.type import Problem


class DownloadHistory(object):
Expand Down
3 changes: 2 additions & 1 deletion onlinejudge_command/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import onlinejudge_command.logging as log
import onlinejudge_command.update_checking as update_checking
import onlinejudge_command.utils as utils
import onlinejudge_workaround_for_conflict.__about__ as api_version # see https://github.com/online-judge-tools/oj/issues/755#issuecomment-623118672
from onlinejudge_command.subcommand.download import download
from onlinejudge_command.subcommand.generate_input import generate_input
from onlinejudge_command.subcommand.generate_output import generate_output
Expand All @@ -19,6 +18,8 @@
from onlinejudge_command.subcommand.test import test
from onlinejudge_command.subcommand.test_reactive import test_reactive

import onlinejudge.__about__ as api_version


def get_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description='Tools for online judge services')
Expand Down
7 changes: 4 additions & 3 deletions onlinejudge_command/subcommand/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
import onlinejudge_command.format_utils as format_utils
import onlinejudge_command.logging as log
import onlinejudge_command.utils as utils
import onlinejudge_workaround_for_conflict.dispatch as dispatch # see https://github.com/online-judge-tools/oj/issues/755#issuecomment-623118672
import requests.exceptions
from onlinejudge_workaround_for_conflict.service.yukicoder import YukicoderProblem # see https://github.com/online-judge-tools/oj/issues/755#issuecomment-623118672
from onlinejudge_workaround_for_conflict.type import SampleParseError, TestCase # see https://github.com/online-judge-tools/oj/issues/755#issuecomment-623118672

import onlinejudge.dispatch as dispatch
from onlinejudge.service.yukicoder import YukicoderProblem
from onlinejudge.type import SampleParseError, TestCase

if TYPE_CHECKING:
import argparse
Expand Down
5 changes: 3 additions & 2 deletions onlinejudge_command/subcommand/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

import onlinejudge_command.logging as log
import onlinejudge_command.utils as utils
import onlinejudge_workaround_for_conflict.dispatch as dispatch # see https://github.com/online-judge-tools/oj/issues/755#issuecomment-623118672
import requests
from onlinejudge_workaround_for_conflict.type import LoginError, Service # see https://github.com/online-judge-tools/oj/issues/755#issuecomment-623118672

import onlinejudge.dispatch as dispatch
from onlinejudge.type import LoginError, Service

if TYPE_CHECKING:
import argparse
Expand Down
5 changes: 3 additions & 2 deletions onlinejudge_command/subcommand/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
import onlinejudge_command.download_history
import onlinejudge_command.logging as log
import onlinejudge_command.utils as utils
import onlinejudge_workaround_for_conflict.dispatch as dispatch # see https://github.com/online-judge-tools/oj/issues/755#issuecomment-623118672
from onlinejudge_workaround_for_conflict.type import * # see https://github.com/online-judge-tools/oj/issues/755#issuecomment-623118672

import onlinejudge.dispatch as dispatch
from onlinejudge.type import *

if TYPE_CHECKING:
import argparse
Expand Down
5 changes: 3 additions & 2 deletions onlinejudge_command/update_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

import onlinejudge_command.__about__ as version
import onlinejudge_command.logging as log
import onlinejudge_workaround_for_conflict.__about__ as api_version
import requests
from onlinejudge_workaround_for_conflict.utils import user_cache_dir

import onlinejudge.__about__ as api_version
from onlinejudge.utils import user_cache_dir


def describe_status_code(status_code: int) -> str:
Expand Down
5 changes: 3 additions & 2 deletions onlinejudge_command/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

import onlinejudge_command.__about__ as version
import onlinejudge_command.logging as log
import onlinejudge_workaround_for_conflict.utils as utils
import requests
from onlinejudge_workaround_for_conflict.type import *

import onlinejudge.utils as utils
from onlinejudge.type import *

user_data_dir = utils.user_data_dir
user_cache_dir = utils.user_cache_dir
Expand Down
3 changes: 2 additions & 1 deletion tests/command_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import tests.utils
from onlinejudge_command.main import get_parser
from onlinejudge_command.subcommand.download import download
from onlinejudge_workaround_for_conflict.type import SampleParseError

from onlinejudge.type import SampleParseError


def get_files_from_json(samples):
Expand Down
3 changes: 2 additions & 1 deletion tests/command_download_invalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import requests.exceptions
import tests.command_download
from onlinejudge_workaround_for_conflict.type import SampleParseError

from onlinejudge.type import SampleParseError


class DownloadInvalidTest(unittest.TestCase):
Expand Down
11 changes: 6 additions & 5 deletions tests/command_login.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import unittest

import tests.utils
from onlinejudge_workaround_for_conflict.service.atcoder import AtCoderService
from onlinejudge_workaround_for_conflict.service.codeforces import CodeforcesService
from onlinejudge_workaround_for_conflict.service.hackerrank import HackerRankService
from onlinejudge_workaround_for_conflict.service.toph import TophService
from onlinejudge_workaround_for_conflict.service.yukicoder import YukicoderService

from onlinejudge.service.atcoder import AtCoderService
from onlinejudge.service.codeforces import CodeforcesService
from onlinejudge.service.hackerrank import HackerRankService
from onlinejudge.service.toph import TophService
from onlinejudge.service.yukicoder import YukicoderService


class LoginTest(unittest.TestCase):
Expand Down
11 changes: 6 additions & 5 deletions tests/command_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import tests.utils
from onlinejudge_command.main import get_parser
from onlinejudge_command.subcommand.submit import submit
from onlinejudge_workaround_for_conflict.service.atcoder import AtCoderService
from onlinejudge_workaround_for_conflict.service.codeforces import CodeforcesService
from onlinejudge_workaround_for_conflict.service.hackerrank import HackerRankService
from onlinejudge_workaround_for_conflict.service.toph import TophService
from onlinejudge_workaround_for_conflict.service.yukicoder import YukicoderService

from onlinejudge.service.atcoder import AtCoderService
from onlinejudge.service.codeforces import CodeforcesService
from onlinejudge.service.hackerrank import HackerRankService
from onlinejudge.service.toph import TophService
from onlinejudge.service.yukicoder import YukicoderService


class SubmitArgumentsTest(unittest.TestCase):
Expand Down
3 changes: 2 additions & 1 deletion tests/implementation_language_guessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import unittest

import onlinejudge_command.subcommand.submit as submit
from onlinejudge_workaround_for_conflict.type import Language, LanguageId

from onlinejudge.type import Language, LanguageId

# https://atcoder.jp/contests/language-test-ver1
languages_atcoder_3 = [
Expand Down