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

python: Remove pipenv #45

Merged
merged 9 commits into from
Mar 14, 2022
Merged

Conversation

jenisys
Copy link
Contributor

@jenisys jenisys commented Mar 13, 2022

🤔 What's changed?

Refactoring of Python implementation of tag-expressions to remove the use of pipenv.
This is part 2 of the removal that removes the use of pipenv from the Makefile, etc. (build system related).

RELATED:

OTHERWISE:

  • Added dotenv to simplify setup of environment variables when python/ directory is entered.
  • PREPARED (and disabled): Auto-creation of Python virtual-environment on entering the python/ directory.
  • Update various Python package versions

FIXES:

  • setup.py outdated URLs due to old repository (same change as PR Fix broken url in python package metadata #29).
  • Correct some package.versions to 4.1.0 (was: 4.0.2).
    REASON: These package.version parts are currently not updated by Makefile when version is bumped.
  • README.rst: Fix the badge to test-python CI build workflow to use GitHub-actions (was: Using old CircleCI badge).
  • tox: Remove py27 virtual environment from envlist until it is really fixed.

⚡️ What's your motivation?

The CI build problem related to PR #40 .
This triggered the refactoring, update and cleanups in the project's build system.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt (improvement to code design or tooling without changing behaviour)
  • 🐛 Bug fix (non-breaking change which fixes a defect) => SEE: FIXES

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation (DEVELOPMENT.rst, README.rst`).
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

jenisys added 9 commits March 13, 2022 19:29
* Makefile mechanism currently patch only the version in "setup.py"
* Other file locations are described in ".bumpversion.cfg" file.
If "dotenv" is setup for the shell:

* On entering this directory: Setup environemnt variables.
* On leaving  this directory: Restore the former environemnt state.

PREPARED (but: .envrc.*.disabled):
* use_venv: Auto-create virtual-environment and activate it.
* use_pep0528: Use PEP-0528 "__pypackages__/$(PYTHON_VERSION)/" directory.

To enable each part, just removed the ".disabled" suffix.
EXAMPLE: Rename ".envrc.use_venv.disabled" to ".envrc.use_venv".
* FIX: Old, broken hyperlinks
* Update Python package dependencies
* Cleanup and reorganize some stuff
* Use "pip" instead of "pipenv"
  HINT: "pipenv" caused multiple problems in the CI build in the past.
* Newer versions of "pip" support install under $HOME directory.
  NOTE: This works without "sudo" and is currently preferred.
* If an virtual-environment was activated, before using "make",
  the Python packages are installed into the virtual-environemnt.

REFACTORING AND CLEANUP (of: Makefile)
* Improve readability and simplify functionality.
github-actions is used as CI build system.
Therefore, use the badge for tests passing from this CI.
WAS: Still using the CircleCI badge before.
Update the "DEVELOPMENT.rst" file to reflect the changed
build procedures and workflow steps.
* Seems to broken due to "pip"
* Remove "py27" from "envlist" for now.

NOTES:
* Can still create a virtual-environment for Python 2.7
* Can still run the tests in virtual-environment
* Added more scripts to simplify setup of virtual-environment

CLEANUP: In Makefile, invoke
* Remove get-pip.py
* Only support for python.version >= 3.7
* Improved version of "tasks/_tasklet_cleanup.py"
* On cleanup/cleanup.all:
  Skips SUICIDE of own virtual-encironment should be deleted.
-------------------------------------------------------------------------------

`direnv`_ simplifies the setup and cleanup of environment variables.
If `direnv`_ is setup:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup -> set up

# (for Python) in the HOME directory of the user (for this directory).
# This makefile uses "pip" to automatically install the required packages:
#
# * CASE 1: If a Python a virtual environment was setup and activated,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup -> set up

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So thoroughly made! And, very helpful context messages and comments added in so many places - perfect. Thanks for all the work on this!

@jenisys jenisys merged commit aa66050 into cucumber:main Mar 14, 2022
jenisys added a commit to jenisys/cucumber.tag-expressions that referenced this pull request Mar 14, 2022
* make install-packages: Improve make output and make it more readable.
* Correct small wording/spelling mistakes comments and docs
  (mentioned by: @olleolleolle in review of PR cucumber#45).
jenisys added a commit that referenced this pull request Mar 14, 2022
* make install-packages: Improve make output and make it more readable.
* Correct small wording/spelling mistakes comments and docs
  (mentioned by: @olleolleolle in review of PR #45).
jenisys added a commit to jenisys/cucumber.tag-expressions that referenced this pull request Mar 14, 2022
* FIX: cucumber-tag-expression in some places.

* Makefile mechanism currently patch only the version in "setup.py"
* Other file locations are described in ".bumpversion.cfg" file.

* PYTHON: Simplify project environment setup with "direnv".

If "dotenv" is setup for the shell:

* On entering this directory: Setup environemnt variables.
* On leaving  this directory: Restore the former environemnt state.

PREPARED (but: .envrc.*.disabled):
* use_venv: Auto-create virtual-environment and activate it.
* use_pep0528: Use PEP-0528 "__pypackages__/$(PYTHON_VERSION)/" directory.

To enable each part, just removed the ".disabled" suffix.
EXAMPLE: Rename ".envrc.use_venv.disabled" to ".envrc.use_venv".

* PYTHON: setup: Fix some hyperlinks

* FIX: Old, broken hyperlinks
* Update Python package dependencies
* Cleanup and reorganize some stuff

* PYTHON: Remove the use of "pipenv"

* Use "pip" instead of "pipenv"
  HINT: "pipenv" caused multiple problems in the CI build in the past.
* Newer versions of "pip" support install under $HOME directory.
  NOTE: This works without "sudo" and is currently preferred.
* If an virtual-environment was activated, before using "make",
  the Python packages are installed into the virtual-environemnt.

REFACTORING AND CLEANUP (of: Makefile)
* Improve readability and simplify functionality.

* PYTHON: Fix the CI build badge

github-actions is used as CI build system.
Therefore, use the badge for tests passing from this CI.
WAS: Still using the CircleCI badge before.

* PYTHON: Update the developer docs.

Update the "DEVELOPMENT.rst" file to reflect the changed
build procedures and workflow steps.

* PYTHON: Try to fix "tox" for Python 2.7

* Seems to broken due to "pip"
* Remove "py27" from "envlist" for now.

NOTES:
* Can still create a virtual-environment for Python 2.7
* Can still run the tests in virtual-environment
* Added more scripts to simplify setup of virtual-environment

CLEANUP: In Makefile, invoke
* Remove get-pip.py

* PYTHON: FIX dependency for "bandit"

* Only support for python.version >= 3.7

* PYTHON: Use invoke_cleanup

* Improved version of "tasks/_tasklet_cleanup.py"
* On cleanup/cleanup.all:
  Skips SUICIDE of own virtual-encironment should be deleted.
jenisys added a commit to jenisys/cucumber.tag-expressions that referenced this pull request Mar 14, 2022
* make install-packages: Improve make output and make it more readable.
* Correct small wording/spelling mistakes comments and docs
  (mentioned by: @olleolleolle in review of PR cucumber#45).
@jenisys jenisys deleted the python/remove_pipenv branch October 20, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants