Skip to content
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
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install pipenv
run: pip install pipenv==2023.5.19
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: pipenv install --skip-lock -d
run: uv sync

- name: Check isort
run: pipenv run isort . --check-only --diff --quiet
run: uv run isort . --check-only --diff --quiet

- name: Check flake8
run: pipenv run lint
run: uv run flake8 --exclude .venv
11 changes: 6 additions & 5 deletions .github/workflows/test-build-msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: |
pip install pipenv==2023.5.19 setuptools wheel
pipenv install -d --skip-lock --system
run: uv sync

- name: Build msi
shell: pwsh
run: |
python setup.py build
python setup.py bdist_msi
uv run python setup.py build
uv run python setup.py bdist_msi
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install pipenv
run: pip install pipenv==2023.5.19
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: pipenv install --skip-lock -d
run: uv sync

- name: Run tests
run: pipenv run test
run: uv run pytest --capture=sys
24 changes: 21 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
ARG PYTHON_VERSION="3.11.3"
ARG PYTHON_VERSION_MAJOR="3"
ARG PYTHON_VERSION_MINOR="11"
ARG PYTHON_VERSION_PATCH="3"
ARG PYTHON_VERSION="${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}"

ARG UV_VERSION="0.5.24"

FROM python:${PYTHON_VERSION}-alpine3.18 AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

WORKDIR /home/nifcloud
COPY . .

RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev


FROM python:${PYTHON_VERSION}-alpine3.18
ARG PYTHON_VERSION_MAJOR
ARG PYTHON_VERSION_MINOR
COPY --from=builder \
/home/nifcloud/.venv/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages \
/usr/local/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages

RUN apk --update add groff

Expand All @@ -13,6 +33,4 @@ ENV PATH="/home/nifcloud/.local/bin:${PATH}"
COPY . .
COPY bin/nifcloud /usr/local/bin/nifcloud

RUN pip install pipenv==2023.5.19 --no-cache-dir --user && pipenv install --system --deploy && pip uninstall -y pipenv

ENTRYPOINT ["/usr/local/bin/nifcloud"]
22 changes: 0 additions & 22 deletions Pipfile

This file was deleted.

696 changes: 0 additions & 696 deletions Pipfile.lock

This file was deleted.

51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["setuptools"]

[project]
name = "nifcloud-cli"
authors = [{name = "Fujitsu"}]
urls = {Homepage = "https://github.com/nifcloud/nifcloud-cli"}
dynamic = ["version"]
description = "NIFCLOUD Command-Line Tools"
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
license = {text = "Apache-2.0"}
dependencies = [
"awscli==1.29.1",
"nifcloud==1.15.0",
"pyyaml==5.3.1",
]
requires-python = ">=3.7.4"

[dependency-groups]
dev = [
"isort",
"flake8",
"cx-freeze==6.15.16",
"sphinx==5.1.1 ; sys_platform != 'win32'",
"sphinx-rtd-theme ; sys_platform != 'win32'",
"pytest",
"pytest-cov",
]

[tool.uv]
package = true

[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"

[tool.uv.sources]
nifcloud-cli = { path = ".", editable = true }
20 changes: 0 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,11 @@ def find_version(*file_paths):


setup(
name='nifcloud-cli',
version=find_version('nifcloudcli', '__init__.py'),
description='NIFCLOUD Command-Line Tools',
long_description=read('README.md'),
long_description_content_type='text/markdown',
author='Fujitsu',
url='https://github.com/nifcloud/nifcloud-cli',
packages=find_packages(exclude=['tests*']),
package_data={'nifcloudcli': ['data/*.json', 'topics/*.json']},
include_package_data=True,
install_requires=['nifcloud==1.15.0', 'awscli==1.29.1', 'pyyaml==5.3.1'],
license='Apache License 2.0',
classifiers=(
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
),
scripts=['bin/nifcloud'],
**cx_freeze_opts,
)
Loading