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

Incompatibility between arbitrary version for Python, poetry, and specified Python version in pyproject.toml #23

Closed
HarmonicReflux opened this issue Jul 25, 2024 · 2 comments · Fixed by #61
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@HarmonicReflux
Copy link
Contributor

HarmonicReflux commented Jul 25, 2024

There is an issue with the current setup instructions for the project. The first step in the how-to guide is to ensure that Poetry is installed, see also "Make sure you have poetry installed."

However, this will not work unless Poetry is running on Python 3.11, which is the version specified in the pyproject.toml file.

Steps to reproduce:

  • Attempt to install Poetry on a system with a Python version other than 3.11.
  • Run poetry install in the project directory.
  • Observe the error indicating that the current Python version is not allowed by the project.

Expected behaviour:

  • Poetry should be able to install and run using the specified Python version in the pyproject.toml.

Actual behaviour:

  • An error is thrown because the current Python version (e.g., 3.9) is not allowed by the project (^3.11).

Proposed solution:

  • Update the setup instructions to ensure the user installs Python 3.11 before installing Poetry.
    This will involve:
  • Clearly stating the requirement for Python 3.11 at the beginning of the guide. Maybe provide or refer to instructions to install Python 3.11 before installing Poetry.

Screenshot from 2024-07-25 20-31-20

Also, on my machine, it was crucial to install the virtual environment like invoking
poetry install --no-root instead of poetry install . Else, I am thrown this warning, which in a future version becomes an error:

Warning: The current project could not be installed: No file/folder found for package rseblog
If you do not want to install the current project use --no-root.
If you want to use Poetry only for dependency management but not for packaging, you can disable package mode by setting package-mode = false in your pyproject.toml file.
In a future version of Poetry this warning will become an error!
@HarmonicReflux HarmonicReflux added bug Something isn't working documentation Improvements or additions to documentation labels Jul 25, 2024
@HarmonicReflux
Copy link
Contributor Author

The following commands solved the problem on my machine. These are equivalently the sequence of commands one might include in the project documentation.

pyenv install 3.11  # assumes pyenv is installed (I could not survive without anymore)
pyenv local 3.11
cd ~/Downloads/vcs/RSEBlog  # navigate to your project directory; path valid for my machine
poetry config virtualenvs.in-project true  # optional to place venv in project directory
poetry install --no-root  # avoids warning "Warning: The current project could not be installed: No file/folder found for package rseblog"

@dalonsoa
Copy link
Collaborator

dalonsoa commented Oct 7, 2024

Lower the required python version to 3.9 to avoid any issues and run poetry lock to update the lock file and spot any incompatibiolity.

alexdewar added a commit that referenced this issue Oct 7, 2024
Given that mkdocs works with a range of Python versions, we don't need to constrain users to a specific version as we do with other projects, so let's relax the requirement a bit to ease local development.

Closes #23.
HarmonicReflux pushed a commit that referenced this issue Oct 25, 2024
Given that mkdocs works with a range of Python versions, we don't need to constrain users to a specific version as we do with other projects, so let's relax the requirement a bit to ease local development.

Closes #23.
dalonsoa added a commit that referenced this issue Oct 29, 2024
* My RSE blog post makes a contribution towards explaining UML and the Strategy Design Pattern followed
by a practical example from option pricing.

In particular, we:
- Introduce UML and its role in software architecture
- Detail the Strategy Pattern and its components (Context, Strategy Interface, ConcreteStrategy)
- Include a practical example of pricing European options using the Black-Scholes-Merton equation
- Integrate relevant mathematical expressions and explanations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* - Making `markdownlint` happy (hopefully) by removing blank lines.
- Fix trailing whitespace issues

* Improved explanation of the financial contract
that is priced in this tutorial.

* Incremental commit of the
restructured introduction that aims at being more explanatory and clearer on what the blog post deals with. This sets and simultaneously limits expectations and provides the reader with a clear overview.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add RSECon24 blog

* Apply suggestions from Dan's review

Co-authored-by: Dan Cummins <[email protected]>

* include avatar links

* include Rivers State

* add some details to conclusion

* some more details

* mlc: Ignore requests to sqlitebrowser.org

* Apply suggestions from code review

Co-authored-by: Alex Dewar <[email protected]>

* Update docs/posts/20240920_rsecon_2024.md

Co-authored-by: Alex Dewar <[email protected]>

* Centre RSECon24 logo

This small change centre-aligns the RSECon24 logo to make it consistent with the RSLondon blog post.

* pyproject.toml: Relax Python version requirements

Given that mkdocs works with a range of Python versions, we don't need to constrain users to a specific version as we do with other projects, so let's relax the requirement a bit to ease local development.

Closes #23.

* Remove codespell and use Spellcheck GitHub action

* Add custom wordlist

* Use preferred character for apostrophe

* Update wordlist

* Change when workflow is run

* Fix CI workflow to fix "externally managed" error

* PR feeback implementation

* Set British dialect

* Trying additional markdown config

* Remove additional markdown config

It does not seem possible to ignore the front matter of the markdown files, meaning that author names, etc., must be included in the whitelist.

* Amend wordlist and fix spelling

* Use pipx to install poetry

* Ignore bad link

* mkdocs: Enable pymdownx.tilde extension

* Fix dead link in RSECon 2022 post

Fixes #70.

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0)
- [github.com/igorshubovych/markdownlint-cli: v0.41.0 → v0.42.0](igorshubovych/markdownlint-cli@v0.41.0...v0.42.0)

* pre-commit: Use `markdownlint-fix` hook cf. `markdownlint`

There's no difference except that `markdownlint-fix` will automatically
fix some errors. Let's use it to minimise the amount of time we have to
spend mindlessly fiddling with whitespace.

* Configure `markdownlint` using config file

This is clearer than adding extra args.

* markdownlint: Re-enable MD041

Requires a top-level heading. See: https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md041---first-line-in-file-should-be-a-top-level-header

None of our posts actually violate this rule, so let's re-enable it.

* pyproject.toml: Remove duplicate entry for pre-commit

* pyproject.toml: Remove redundant docs group

* pyproject.toml: Fix name of package

* pyproject.toml: Fix email

* Regenerate poetry.lock

* - Improved tutorial: Adapted functional programming paradigm and changed UML diagrams and Oython code accordingly.
- Expanded the overall text.
- Included a section on the put-call parity to test the fair pricing
- Increased the number of references

* attempt to avoid spell-checking code blocks as well as references.

* another attempt to save spell checker from itself by modifying
`.spellcheck.yml`

* .

* .

* .

* .

* .

* Implemented most of Alex's review requests.

Moreover, I reformatted the references sections as well as in-text references.

Also, I slightly refined the text for fluency and improved some explanations.

* Amended `References` section so markdown lint stops complaining. The original implementation renders beautifully and without errors on my local machine, but the pre-commit hooks complain.

* attempt to make spellcheck pass.The only place I have 'Modeling' in my blog post is in the References section and I thought to disable spellcheck like so

<!-- spell-check-ignore -->
...
<!-- end-spell-check-ignore -->

will make it pass, but as it stands it does not.

* Implemented reviewer's suggestions.

* Make Spellcheck pass. All else is good to go.

* Make Spellcheck pass. All else is good to go.

* Apply suggestions from code review

Co-authored-by: Dan Cummins <[email protected]>

* Update docs/posts/20241031_design_patterns_2024.md

* Update docs/posts/20241031_design_patterns_2024.md

* Update 20241031_design_patterns_2024.md

Committed @dc2917's suggestion.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Diego Alonso Álvarez <[email protected]>
Co-authored-by: Saranjeet Kaur <[email protected]>
Co-authored-by: Dan Cummins <[email protected]>
Co-authored-by: Alex Dewar <[email protected]>
Co-authored-by: Alex Dewar <[email protected]>
Co-authored-by: Adrian D'Alessandro <[email protected]>
Co-authored-by: Ryan Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants