Skip to content

Commit

Permalink
setuptools -> hatchling
Browse files Browse the repository at this point in the history
  • Loading branch information
CroMarmot committed Jun 30, 2023
1 parent f88f0b4 commit 420cd66
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 40 deletions.
2 changes: 1 addition & 1 deletion ac_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.3.3"
6 changes: 3 additions & 3 deletions ac_core/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from bs4 import BeautifulSoup
import bs4

from .constant import _SITE_URL
from .interfaces.HttpUtil import HttpUtilInterface
from .utils import HTML_PARSER
from ac_core.constant import _SITE_URL
from ac_core.interfaces.HttpUtil import HttpUtilInterface
from ac_core.utils import HTML_PARSER

logger = getLogger(__name__)

Expand Down
12 changes: 6 additions & 6 deletions ac_core/contest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from bs4 import BeautifulSoup
import bs4

from .modal.problem_test_case import ProblemTestCase
from .interfaces.HttpUtil import HttpUtilInterface
from .problem import parse_task
from .utils import HTML_PARSER, remove_suffix
from .constant import _SITE_URL
from .utils.html_parse_helper import parse_start_end, parse_url
from ac_core.modal.problem_test_case import ProblemTestCase
from ac_core.interfaces.HttpUtil import HttpUtilInterface
from ac_core.problem import parse_task
from ac_core.utils import HTML_PARSER, remove_suffix
from ac_core.constant import _SITE_URL
from ac_core.utils.html_parse_helper import parse_start_end, parse_url


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions ac_core/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from bs4 import BeautifulSoup, Tag

from .constant import _SITE_URL
from .interfaces.HttpUtil import HttpUtilInterface
from ac_core.constant import _SITE_URL
from ac_core.interfaces.HttpUtil import HttpUtilInterface


@dataclass
Expand Down
8 changes: 4 additions & 4 deletions ac_core/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from bs4 import BeautifulSoup
import bs4
from .constant import _SITE_URL
from .modal.problem_test_case import ProblemTestCase
from .utils import HTML_PARSER, get_direct_children_text, remove_prefix, remove_suffix
from .utils.html_parse_helper import parse_start_end, parse_url
from ac_core.constant import _SITE_URL
from ac_core.modal.problem_test_case import ProblemTestCase
from ac_core.utils import HTML_PARSER, get_direct_children_text, remove_prefix, remove_suffix
from ac_core.utils.html_parse_helper import parse_start_end, parse_url

logger = getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions ac_core/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import re

from bs4 import BeautifulSoup
from .constant import _SITE_URL
from .interfaces.HttpUtil import HttpUtilInterface
from ac_core.constant import _SITE_URL
from ac_core.interfaces.HttpUtil import HttpUtilInterface


@dataclass
Expand Down
8 changes: 4 additions & 4 deletions ac_core/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from bs4 import BeautifulSoup
import bs4

from .constant import _SITE_URL
from .interfaces.HttpUtil import HttpUtilInterface, HttpRespInterface
from .url import url_2_contest_id
from .utils import HTML_PARSER
from ac_core.constant import _SITE_URL
from ac_core.interfaces.HttpUtil import HttpUtilInterface, HttpRespInterface
from ac_core.url import url_2_contest_id
from ac_core.utils import HTML_PARSER


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion ac_core/url.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re

from urllib.parse import urlparse
from .utils import remove_suffix
from ac_core.utils import remove_suffix


def url_2_contest_id(url: str) -> str:
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
project = 'yxr-atcoder-core'
copyright = '2023, Cro-Marmot'
author = 'Cro-Marmot'
release = '0.0.2'
from ac_core import __version__
release = __version__

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
19 changes: 19 additions & 0 deletions docs/dev/06_publish.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
=======
Publish
=======


config `~/.pypirc` follow https://packaging.python.org/en/latest/specifications/pypirc/

.. code-block::
python -m build
twine check dist/*
# upload to test server
twine upload --repository testpypi dist/*
pip install --index-url https://test.pypi.org/simple/ --no-deps yxr-atcoder-core==<VERSION>
...
# upload
twine upload dist/*
# If you use a mirror of PIP, through designated official pypi to test whether the upload successfully
pip install --index-url https://pypi.org/simple/ yxr-atcoder-core==<VERSION>
5 changes: 3 additions & 2 deletions docs/dev/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Developer
===========

Menu
Menu
------

.. toctree::
Expand All @@ -13,6 +13,7 @@ Menu
03_lint
04_autotest
05_rst_examples
06_publish

Lib in use
----------
Expand All @@ -32,4 +33,4 @@ Lib in use

.. _yapf: https://github.com/google/yapf

.. _requests: https://requests.readthedocs.io/en/latest/
.. _requests: https://requests.readthedocs.io/en/latest/
6 changes: 3 additions & 3 deletions docs/usage/00_install.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Install
=======

with github
From github
-----------

.. code-block::
Expand All @@ -11,8 +11,8 @@ with github
# Install at local
pip3 install -e . --config-settings editable_mode=compat
Future(NOT SUPPORT YET!WIP)
---------------------------
From Pypi
---------

.. code-block::
Expand Down
26 changes: 15 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
[build-system]
requires = [
"setuptools",
"wheel"
]
build-backend = "setuptools.build_meta"
requires = [ "hatchling" ]
build-backend = "hatchling.build"

[project]
name = "yxr-atcoder-core"
description = "Simple Atcoder core api"
version = "0.0.2"
authors = [
{ name="YeXiaoRain", email="yexiaorain@gmail.com" }
]
Expand All @@ -32,6 +28,7 @@ classifiers = [
]
keywords = ["atcoder", "api", "yxr"]
license = { file="LICENSE" }
dynamic = ["version"]

[project.urls]
"Homepage" = "https://github.com/CroMarmot/yxr-atcoder-core"
Expand All @@ -45,11 +42,18 @@ test = [
'mypy',
]

[tool.setuptools.packages.find]
where = ["."] # default "."
include = ["ac_core"] # ["*"] by default
exclude = ["TODO.md", "tests", "docs"] # empty by default
namespaces = true # true by default
[tool.hatch.build]
ignore-vcs = true
include = [
"ac_core",
]
exclude = [
"tests",
"docs",
]

[tool.hatch.version]
path = "ac_core/__init__.py"

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down

0 comments on commit 420cd66

Please sign in to comment.