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

Update package installation files and development environment #248

Merged
merged 45 commits into from
Apr 18, 2024

Conversation

tieneupin
Copy link
Contributor

@tieneupin tieneupin commented Apr 4, 2024

Partially addresses issue #194 .

  • Updated [options.extras_require] table in setup.cfg to include dependencies for client, server, and developer installations of Murfey. More than one can be called during pip installation (e.g. to install all three for development use, input pip install -e .[client,server,developer]).
  • Imported configuration settings from setup.cfg to pyproject.toml. Pip can now successfully install Murfey solely off pyproject.toml.
    • Python versions tested:
      • 3.12.2
      • 3.11.8
      • 3.10.14
      • 3.9.19

Eu Pin Tien added 4 commits April 4, 2024 14:03
…ient, server, and developer installations. Commented on sections of code that have been successfully ported over to pyproject.toml. Rearranged groups for human readability.
…ed for pip installation of Murfey. Tested with Python 3.11.8.
@tieneupin tieneupin requested a review from d-j-hatton April 4, 2024 13:35
…ss. Doesn't appear to be working just yet. Will need to find plugin that allows flake8 to interpret .toml configuration entries.
…version information). Pre-commit now runs through to completion, albeit with many errors.
…g.yaml file, allowing pre-commit to correctly implement Flake8 checks using the settings specified in the pyproject.toml file. Currently, only the mypy check is still failing.
@tieneupin
Copy link
Contributor Author

tieneupin commented Apr 5, 2024

  • Updated pre-commit-config.yaml to use the latest versions of pre-commit-hooks, isort, black, flake8, and mirrors-mypy for its checks.
  • Added Flake8-pyproject as a Flake8 dependency, which allows it to read Flake8 configuration settings from the pyproject.toml file.
  • Current results when running pre-commit:
    • check for merge conflicts....................................Passed
    • check python ast.................................................Passed
    • check json...........................................................Passed
    • check for added large files..................................Passed
    • check yaml..........................................................Passed
    • isort.....................................................................Passed
    • black....................................................................Passed
    • flake8...................................................................Passed
    • mypy....................................................................Failed
      • hook id: mypy
      • exit code: 1

…for behavioural differences between single and double quotes.
…potentially be None, so encased paragraph in an if block to check if TransportManager is valid.
… no attribute MurfeyTUI. Commented out paragraphs associated with that function until confirmation that file is no longer needed.
@tieneupin
Copy link
Contributor Author

tieneupin commented Apr 5, 2024

  • Started addressing errors revealed by pre-commit:
    • src/murfey/util/eer.py:14: error: Argument 2 to "from_bytes" of "int" has incompatible type "str"; expected "Literal['little', 'big']" [arg-type]
    • src/murfey/util/eer.py:21: error: Argument 2 to "from_bytes" of "int" has incompatible type "str"; expected "Literal['little', 'big']" [arg-type]
    • src/murfey/util/eer.py:23: error: Argument 2 to "from_bytes" of "int" has incompatible type "str"; expected "Literal['little', 'big']" [arg-type]
    • src/murfey/client/tui/__main__.py:3: error: Module "murfey.client.tui" has no attribute "MurfeyTUI" [attr-defined]
    • src/murfey/server/__init__.py:2712: error: Item "None" of "TransportManager | None" has no attribute "do_create_ispyb_job" [union-attr]
    • src/murfey/server/api.py:709: error: Value of type "Coroutine[Any, Any, None]" must be used [unused-coroutine]
  • All MyPy errors resolved.

… Pre-Commit settings in pyproject.toml and pre-commit-config.yaml instead.
…non-critical warning messages, and print out clearer messages.
@tieneupin
Copy link
Contributor Author

tieneupin commented Apr 8, 2024

  • Compared Ruff pre-commit hook against the combination of Black, Isort, and Flake8 hooks.
    • Ruff formatting deviates from Black's in certain ways (https://docs.astral.sh/ruff/formatter/black/).
    • Ruff linter doesn't yet cover all the Flake8 rules selected/ignored in this project.
      • VSCode throws up a warning only when certain codes are added to the select/ignore lists for Ruff in the pyproject.toml file. Other codes are fine.
    • Given our current project size, both sets of hooks complete at roughly the same speed.
  • Updated MyPy pre-commit hook settings to include arguments to install missing type dependencies, and to ignore non-critical warnings.

@tieneupin
Copy link
Contributor Author

  • Removal of setup.cfg broke Azure's Flake8 checks (Flake8 cannot read pyproject.toml by default).
    • Fixed by Dan via installing pyproject-flake8 extension when setting up Azure's tests.

@tieneupin
Copy link
Contributor Author

Added Prettier pre-commit hook to standardise formatting of non-Python files.

@tieneupin tieneupin changed the title Updated project setup files Updated package installation files Apr 17, 2024
@tieneupin tieneupin changed the title Updated package installation files Updated package installation files and development environment Apr 17, 2024
@tieneupin tieneupin changed the title Updated package installation files and development environment Update package installation files and development environment Apr 17, 2024
@tieneupin tieneupin linked an issue Apr 17, 2024 that may be closed by this pull request
@tieneupin tieneupin merged commit bd7b289 into main Apr 18, 2024
9 checks passed
@tieneupin tieneupin deleted the setup-update branch April 18, 2024 13:35
@tieneupin tieneupin self-assigned this May 9, 2024
@tieneupin tieneupin added the ci-cd Improvements to project development environment label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd Improvements to project development environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Murfey package installation and development environment
2 participants