Comments (11)
fysa it appears that open-dis-python
requires numpy
which requires python 3.9 per: #50 (comment)
from open-dis-python.
Assuming there is no major prior use of open-dis-python that needs backward compatibility to be supported, I would recommend the following minimum versions:
Python 3.5
This is the earliest version that supports type annotations in functions and methods. This would make the code more readable and easier to understand at a glance, especially for those used to type specifications from Java and C++
Annotated functions, before and after
Python 3.7
This is the earliest version that introduces dataclasses and the dataclass
decorator and field
object. The dataclass
decorator uses type annotations on class attributes and uses them to provide default __init__()
and __repr__()
behaviour, which make introspection much easier with less code.
Before dataclass
After dataclass (with type annotations)
from open-dis-python.
@ngjunsiang It's difficult to know what version of Python users of the library are using.
I see that Python 3.5 was released in 2015 and Python 3.7 in 2018. And based on W3 stats for Python 3 (I'm not sure if these are the best stats) I see the following use in the Python 3 community:
- 1.2% of users are using a version older than 3.5.
- 33.8% of users are using a version older than 3.7.
Based on those stats, we may alienate up to 1/3 of the users by upgrading to 3.7 today, whereas almost no one would be impacted by updating to 3.5. On this info alone, I would suggest setting the base version to 3.5.
Two questions for the open-dis-python community. Lets leave this question open for a week to collect feedback.
- Are you using a version of Python older than 3.5?
- Would you be able to upgrade your application to Python 3.5?
from open-dis-python.
Didn't think of this option:
pip install git+https://github.com/open-dis/open-dis-python
works as is until a package is created in the global pypi.
from open-dis-python.
@ztolley yes that was my intent. I tried a while back and hit a snag, maybe it's time I retry.
from open-dis-python.
Could I check what is the oldest version of Python 3 this package would be intended to support?
from open-dis-python.
@ngjunsiang i'm not sure how to determine that
from open-dis-python.
I am asking primarily because this would determine the main style and syntax to be used (e.g. class DataQueryDatumSpecification( object ):
is required by Python2, but Python3 only requires class DataQueryDatumSpecification:
)
Secondarily, Python3 versions 3.7 and up add new syntax features that might not be supported in earlier versions. E.g. dataclasses are only available for version 3.7, and would need an external import for support in 3.6 and earlier.
I noted that the README states this is a Python 3 implementation of DIS 7, so I assume this is not meant to be backward-compatible with any Python version earlier than 3.0. I am trying to determine which newer Python features I can use if I want to make any pull requests.
Furthermore, if packaging work is to be done, the Python requirement needs to be stated in pyproject.toml
(with reference to the Python Packaging User Guide). I can help with this work when my commitments free up somewhat in the second half of this year. But I don't know how to begin finding out where open-dis-python is already being adopted, so as to avoid breaking backward compatibility with those projects if they switch to a pip-based install instead of building from source.
from open-dis-python.
Maybe consider a pyproject.toml
?
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
for enabling poetry-like integrations: https://python-poetry.org/docs/pyproject/
from open-dis-python.
This issue would make installing to Dockerfiles much easier also. I'm wondering if a docker swarm/k8s example would be worth the effort?
from open-dis-python.
@scottrbrtsn good catch. If we're already dependent on 3.9+ then we might as well stay with that baseline version.
from open-dis-python.
Related Issues (20)
- Issue with dis_recieve.py createPdu() HOT 4
- Apply feedback to examples from Stackoverflow question
- VariableDatum object does not serialize padding HOT 3
- Divide by zero in RangeCoordinates.py HOT 3
- Allow for multiple receivers on same UDP address/port HOT 3
- ElectronicEmmisionsPdu does not handle beams correctly HOT 1
- Example sender isn't looping as suggested in README HOT 3
- SignalPdu Not Packing Data Correctly HOT 4
- Feature request: Local to Euler angles conversion HOT 2
- EmissionSystemBeamRecord.serialize incorrectly contains outputStream read calls instead of write
- Typographical Error in ReceiverPdu HOT 2
- not an issue but a question surrounding performance HOT 1
- signed bytes in signal pdu HOT 1
- Something seems to be very off in the way the data is packed up
- Confusing naming for identifiers
- Boundary padding for records and PDUs HOT 11
- Inconsistent naming for attributes representing a count
- Config options mapped to symbolic names (6.1.8)
- Error Running Example dis_sender.py HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-dis-python.