Skip to content

Commit

Permalink
change package manager to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshit-MQ committed Aug 21, 2024
1 parent 304d3d3 commit 1382697
Show file tree
Hide file tree
Showing 11 changed files with 812 additions and 473 deletions.
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 wheel
- 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
14 changes: 7 additions & 7 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,21 +38,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 wheel
- 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
Expand Down
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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"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": ""
Expand Down
16 changes: 0 additions & 16 deletions Pipfile

This file was deleted.

428 changes: 0 additions & 428 deletions Pipfile.lock

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@ 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
poetry install --dev
```

To delete the currently used virtual environment run:

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

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 Down
10 changes: 5 additions & 5 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ 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"
Invoke-CommandLine -CommandLine "$PipInstaller poetry wheel"
ReloadEnvVars
Invoke-CommandLine -CommandLine "$PipInstaller --upgrade pip"
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

0 comments on commit 1382697

Please sign in to comment.