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

change package manager to poetry #56

Merged
merged 1 commit into from
Aug 28, 2024
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
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install pipenv
- name: Install poetry
run: |
python -m pip install --upgrade pipenv wheel
python -m pip install --upgrade poetry
- name: Install dependencies
run: |
pipenv install --deploy --dev
poetry install
- name: Run test suite
run: |
pipenv run python -m pytest --verbose --capture=tee-sys
poetry run python -m pytest --verbose --capture=tee-sys
- name: Build package
run: |
pipenv run python -m build
poetry build
- name: Create documentation
run: |
pipenv run make --directory doc html
poetry run make --directory doc html
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pipenv and pytest execution inspired by
# poetry and pytest execution inspired by
# https://github.com/okeeffed/hello-pytest-github-actions/

name: Ubuntu
Expand Down Expand Up @@ -38,23 +38,23 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install pipenv
- name: Install poetry
run: |
python -m pip install --upgrade pipenv wheel
python -m pip install --upgrade poetry
- name: Install dependencies
run: |
pipenv install --deploy --dev
poetry install
- name: Run test suite
run: |
pipenv run python -m pytest --verbose --capture=tee-sys
poetry run python -m pytest --verbose --capture=tee-sys
- name: Build package
run: |
pipenv run python -m build
poetry build
- name: Create documentation
run: |
pipenv run make --directory doc html
poetry run make --directory doc html
- name: Publish documentation
if: github.ref == 'refs/heads/develop'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: doc/build/html # The folder the action should deploy.
folder: doc/build/html # The folder the action should deploy.
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pipenv and pytest execution inspired by
# poetry and pytest execution inspired by
# https://github.com/okeeffed/hello-pytest-github-actions/

name: Windows
Expand Down
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
"peacock.color": "#f9e64f",
"cmake.sourceDirectory": "${workspaceFolder}/tests/data/mini_c_test",
"cmake.environment": {
"PIPENV_MAX_DEPTH" : "10"
"poetry_MAX_DEPTH" : "10"
},
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"esbonio.sphinx.confDir": ""
}
"esbonio.sphinx.confDir": "",
"cmake.configureOnOpen": false
}
16 changes: 0 additions & 16 deletions Pipfile

This file was deleted.

428 changes: 0 additions & 428 deletions Pipfile.lock

This file was deleted.

18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,30 @@ Automatic mocking tool for C

## Build

This project uses [Pipenv](https://pypi.org/project/pipenv/). Run the following command to install it using your system's Python >=3.6 installation:
This project uses [poetry](https://pypi.org/project/poetry/). Run the following command to install it using your system's Python >=3.6 installation:

```shell
pip install pipenv
pip install poetry
```

To create a virtual environment for development run:

```shell
pipenv install --dev
```

To delete the currently used virtual environment run:

```shell
pipenv --rm
poetry install
```

To debug your Python code in VS Code you need to activate the virtual environment. To activate this project's virtualenv, run:

```shell
pipenv shell
poetry shell
```

After that you can select the virtual env in the list of Python installations.

Run all tests:

```shell
pipenv run pytest --verbose --capture=tee-sys
poetry run pytest --verbose --capture=tee-sys
```

TODO: Somehow pytest fails when already installed in the system's python distribution. Uninstall it:
Expand All @@ -63,4 +57,4 @@ Used libraries/sources/repos:
$ # Change version in setup.py to e.g. 0.5.0
$ python setup.py sdist
$ twine upload --repository-url https://test.pypi.org/legacy/dist/hammock-0.5.0.tar.gz
```
```
12 changes: 5 additions & 7 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ if ($installMandatory) {
Invoke-CommandLine -CommandLine "scoop update"
ScoopInstall(Get-Content 'install-mandatory.list')
$PipInstaller = "python -m pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org"
Invoke-CommandLine -CommandLine "$PipInstaller pipenv wheel"
ReloadEnvVars
Invoke-CommandLine -CommandLine "$PipInstaller --upgrade pip"
Invoke-CommandLine -CommandLine "$PipInstaller poetry"
ReloadEnvVars
}

Invoke-CommandLine -CommandLine "pipenv install --deploy --dev"
Invoke-CommandLine -CommandLine "pipenv run python -m pytest --verbose --capture=tee-sys"
Invoke-CommandLine -CommandLine "pipenv run python -m build"
Invoke-CommandLine -CommandLine "pipenv run make --directory doc html"
Invoke-CommandLine -CommandLine "poetry install"
Invoke-CommandLine -CommandLine "poetry run python -m pytest --verbose --capture=tee-sys"
Invoke-CommandLine -CommandLine "poetry build"
Invoke-CommandLine -CommandLine "poetry run make --directory doc html"

Pop-Location
Loading
Loading