From 2acc17b6f9ce0463ee0382a8cc36802f5eb95e59 Mon Sep 17 00:00:00 2001 From: Martin Scavnicky Date: Sat, 15 Aug 2020 13:32:00 +0200 Subject: [PATCH] Convert package to poetry. --- .bumpversion.cfg | 2 +- .gitignore | 2 +- .semaphore/semaphore.yml | 18 +++++++++--------- Pipfile | 22 ---------------------- bin/bumpversion | 8 -------- bin/package | 3 --- bin/release | 11 ++++++++++- bin/test | 2 +- pyproject.toml | 31 +++++++++++++++++++++++++++++++ setup.py | 22 ---------------------- 10 files changed, 53 insertions(+), 68 deletions(-) delete mode 100644 Pipfile delete mode 100755 bin/bumpversion delete mode 100755 bin/package create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index f3b3a7b..e1dd602 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -4,4 +4,4 @@ tag = True message = Release version {new_version} current_version = 0.0.7 -[bumpversion:file:setup.py] +[bumpversion:file:pyproject.toml] diff --git a/.gitignore b/.gitignore index 47526a7..b3a4368 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ build dist *.egg-info -Pipfile.lock +poetry.lock \ No newline at end of file diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 3325dd0..7c3b54d 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -22,9 +22,9 @@ blocks: jobs: - name: run commands: - - pip3 install pipenv - - pipenv install --dev - - pipenv run python -m unittest --verbose + - pip3 install poetry + - poetry install + - poetry run python -m unittest --verbose - name: test-3.7 dependencies: [] task: @@ -41,9 +41,9 @@ blocks: jobs: - name: run commands: - - pip3 install pipenv - - pipenv install --dev - - pipenv run python -m unittest --verbose + - pip3 install poetry + - poetry install + - poetry run python -m unittest --verbose - name: test-3.8 dependencies: [] task: @@ -60,6 +60,6 @@ blocks: jobs: - name: run commands: - - pip3 install pipenv - - pipenv install --dev - - pipenv run python -m unittest --verbose \ No newline at end of file + - pip3 install poetry + - poetry install + - poetry run python -m unittest --verbose \ No newline at end of file diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 1809bf9..0000000 --- a/Pipfile +++ /dev/null @@ -1,22 +0,0 @@ -[[source]] -name = "pypi" -url = "https://pypi.org/simple" -verify_ssl = true - -[dev-packages] -# Used for releasing package to pypi. -twine = "*" -bump2version = ">=1.0.0" -vcrpy = "*" - -[packages] -parsel = ">=1.2.0" -lxml = ">=4.1.1" -cssselect = ">=1.0.3" -aiohttp = ">=3.0.9" - -[requires] -python_version = "3" - -[pipenv] -allow_prereleases = true diff --git a/bin/bumpversion b/bin/bumpversion deleted file mode 100755 index 0e11929..0000000 --- a/bin/bumpversion +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -if [[ $# -eq 0 ]]; then - echo "Part missing (major, minor, patch)." - exit 1 -fi - -pipenv run bumpversion $1 --verbose \ No newline at end of file diff --git a/bin/package b/bin/package deleted file mode 100755 index 6cdcd0d..0000000 --- a/bin/package +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -pipenv run python setup.py sdist bdist_wheel \ No newline at end of file diff --git a/bin/release b/bin/release index 6377f1b..442281c 100755 --- a/bin/release +++ b/bin/release @@ -1,3 +1,12 @@ #!/bin/bash -pipenv run twine upload dist/* \ No newline at end of file +if [[ $# -eq 0 ]]; then + echo "Please specify a version bump - major, minor, or patch." + exit 1 +fi + +poetry run bumpversion $1 --verbose + +poetry build + +poetry publish \ No newline at end of file diff --git a/bin/test b/bin/test index 8675a0a..84e3d16 100755 --- a/bin/test +++ b/bin/test @@ -1,3 +1,3 @@ #!/bin/bash -pipenv run python -m unittest $@ \ No newline at end of file +poetry run python -m unittest $@ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ebeeb66 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[tool.poetry] +name = "hypotonic" +version = "0.0.7" +description = "Fast asynchronous web scraper with minimalist API." +authors = ["Martin Scavnicky "] +license = "MIT" +homepage = "https://github.com/mscavnicky/hypotonic" +readme = "README.md" +classifiers = [ + 'Development Status :: 2 - Pre-Alpha', + 'Operating System :: OS Independent', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3', + 'Topic :: Text Processing :: Markup :: HTML' +] + +[tool.poetry.dependencies] +python = "^3.6" +parsel = ">=1.2.0" +lxml = ">=4.1.1" +cssselect = ">=1.0.3" +aiohttp = ">=3.0.9" + +[tool.poetry.dev-dependencies] +bumpversion = ">=0.5.0" +vcrpy = ">=3.0.0" + + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 1343c01..0000000 --- a/setup.py +++ /dev/null @@ -1,22 +0,0 @@ -from setuptools import setup, find_packages - -setup(name='hypotonic', - version='0.0.7', - description='Fast asynchronous web scraper with minimalist API.', - long_description='Fast asynchronous web scraper with minimalist API.', - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Operating System :: OS Independent', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Topic :: Text Processing :: Markup :: HTML' - ], - url='https://github.com/mscavnicky/hypotonic', - author='Martin Scavnicky', - author_email='martin.scavnicky@gmail.com', - license='MIT', - packages=find_packages(exclude=['tests']), - install_requires=['aiohttp', 'parsel', 'lxml', 'cssselect'], - include_package_data=True, - zip_safe=False)