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

Adds some dev tools and separates out dev requirements.txt #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
# Recommended settings from black
max-line-length = 80
extend-select = B950
extend-ignore = E203,E501,E701
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
exclude: "projects/"
default_language_version:
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: requirements-txt-fixer
- id: detect-private-key
- id: name-tests-test
args: ["--pytest-test-first"]
- id: check-added-large-files
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black-pre-commit-mirror
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
rev: 24.10.0
hooks:
- id: black
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ The idea of gtnh-flow is to automatically do all the machine balancing math for
+ Sometimes the balancing algorithm will fail. This is explained in more detail in ## It's still beta. You may need to manually make adjustments to some shared ingredients to separate them from other machines. The easiest way to do this is is by renaming the ingredient slightly, like `chlorine 1` and `chlorine 2`. This will cause it to no longer automatically be used in any machine that needs chlorine, just the one you want. You can see this technique used regularly for platline.

## It's still beta
`gtnh-flow` cannot solve certain parallel edge product situations - this is hopefully being resolved in version 2, which is currently in pre-alpha development. It will take a while as I am trying to avoid the way Factorio solvers work, which is to define an "objective" value for every item in the game. This is impractical to do and permanently maintain for GTNH.
`gtnh-flow` cannot solve certain parallel edge product situations - this is hopefully being resolved in version 2, which is currently in pre-alpha development. It will take a while as I am trying to avoid the way Factorio solvers work, which is to define an "objective" value for every item in the game. This is impractical to do and permanently maintain for GTNH.

## Development

1. Create a virtualenv and activate it
2. Run `pip install -r requirements_dev.txt`
3. Run `pre-commit install`
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
graphviz>=0.17
pytest>=6.2.5
graphviz>=0.20
pyreadline3>=3.5
pyyaml>=6.0
pyreadline3>=3.4.1
sympy>=1.11.1
termcolor>=1.1.0
sympy>=1.13
termcolor>=2.5
8 changes: 8 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
black>=24.8
coverage>=7.6
flake8>=7.1
isort>=5.13
mypy>=1.11
pre-commit>=3.8
pytest>=8.3
pytest-check>=2.4