Skip to content

Commit

Permalink
Merge pull request #54 from bjoernricks/remove-setuptools-support
Browse files Browse the repository at this point in the history
Remove setuptools support
  • Loading branch information
bjoernricks committed Apr 9, 2020
2 parents c2b9192 + b0da090 commit b3dbf8c
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 265 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ commands:
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
name: Create environment and update pip
command: poetry run pip install --upgrade pip
- run:
name: Install dependencies
command: poetry install --no-dev
Expand All @@ -34,8 +34,8 @@ commands:
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
name: Create environment and update pip
command: poetry run pip install --upgrade pip
- run:
name: Install dependencies
command: poetry install --no-dev
Expand All @@ -47,8 +47,8 @@ commands:
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
name: Create environment and update pip
command: poetry run pip install --upgrade pip
- run:
name: Install dependencies
command: poetry install --no-dev
Expand All @@ -66,8 +66,8 @@ commands:
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
name: Create environment and update pip
command: poetry run pip install --upgrade pip
- run:
name: Install dependencies
command: poetry install
Expand All @@ -88,8 +88,8 @@ commands:
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
name: Create environment and update pip
command: poetry run pip install --upgrade pip
- run:
name: Install dependencies
command: poetry install --no-dev
Expand All @@ -108,10 +108,10 @@ commands:
echo -e "username = __token__" >> ~/.pypirc
echo -e "password = $PYPI_TOKEN" >> ~/.pypirc
- run:
name: Create and upload distribution to pypi
name: Create and upload distributions to pypi
command: |
rm -rf dist build python_gvm.egg-info
poetry build --format sdist
poetry build
poetry run twine upload dist/*
jobs:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#49](https://github.com/greenbone/autohooks/pull/49)

### Removed
* Removed code relying on setuptools and switched to a full poetry build
process [#54](https://github.com/greenbone/autohooks/pull/54)

[Unreleased]: https://github.com/greenbone/autohooks/compare/v2.0.0...master

Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

49 changes: 1 addition & 48 deletions autohooks/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from typing import Any, Dict, List, Union, Optional
from typing import Any, Dict, List, Union
from pathlib import Path

import tomlkit

from autohooks.settings import Mode
from autohooks.utils import get_pyproject_toml_path
from autohooks.version import safe_version

AUTOHOOKS_SECTION = 'tool.autohooks'

Expand Down Expand Up @@ -57,52 +56,6 @@ def get_config(self) -> Config:
return self._config


class PoetryConfig(BaseToolConfig):
def __init__(self, config_dict: Dict = None) -> None:
super().__init__(config_dict)
self._poetry_config = self._config.get('tool').get('poetry')

@staticmethod
def from_pyproject_toml(pyproject_toml: Path = None) -> "PoetryConfig":
if pyproject_toml is None:
pyproject_toml = get_pyproject_toml_path()

if not pyproject_toml.exists():
return PoetryConfig()

config_dict = tomlkit.loads(pyproject_toml.read_text())
return PoetryConfig(config_dict)

def has_poetry_config(self) -> bool:
return not self._poetry_config.is_empty()

def get_version(self) -> Optional[str]:
version = self._poetry_config.get_value('version')

return safe_version(version) if version else None

def get_name(self) -> Optional[str]:
return self._poetry_config.get_value('name')

def get_description(self) -> Optional[str]:
return self._poetry_config.get_value('description')

def get_homepage(self) -> Optional[str]:
return self._poetry_config.get_value('homepage')

def get_repository(self) -> Optional[str]:
return self._poetry_config.get_value('repository')

def get_license(self) -> Optional[str]:
return self._poetry_config.get_value('license')

def get_classifiers(self) -> List[str]:
return self._poetry_config.get_value('classifiers', [])

def get_scripts(self) -> Dict[str, str]:
return self._poetry_config.get_value('scripts', {})


class AutohooksConfig(BaseToolConfig):
def __init__(self, config_dict: Dict = None) -> None:
super().__init__(config_dict)
Expand Down
45 changes: 0 additions & 45 deletions autohooks/install.py

This file was deleted.

52 changes: 26 additions & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[build-system]
requires = ["setuptools", "toml", "wheel"]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

[tool.poetry]
name = "autohooks"
Expand All @@ -25,13 +26,22 @@ classifiers=[
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Version Control :: Git",
]
keywords = [
"git",
"formatting",
"linting",
"hooks",
]

packages = [
{ include = "autohooks"},
{ include = "tests", format = "sdist" },
{ include = "CHANGELOG.md", format = "sdist"},
{ include = "RELEASE.md", format = "sdist"},
{ include = "poetry.lock", format = "sdist"},
{ include = "poetry.toml", format = "sdist"},
]
include = [
"CHANGELOG.md",
"autohooks/precommit/template",
]

Expand All @@ -40,7 +50,6 @@ python = "^3.5"
colorful = "^0.5.4"
packaging = "^20.3"
tomlkit = "^0.5.11"
setuptools = "^46.1.3"

[tool.poetry.dev-dependencies]
pylint = "^2.4.4"
Expand Down
65 changes: 0 additions & 65 deletions setup.py

This file was deleted.

0 comments on commit b3dbf8c

Please sign in to comment.